Changeset 4f02618e7c8717451f2d3eda9e7d72daf17f36ca

Show
Ignore:
Timestamp:
08/19/07 16:03:22 (1 year ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1187532202 +0200
git-parent:

[ad0b63630c98d5dda12260a60f1f4a5ce8d63336]

git-author:
Sebastian Gift <Madison@gt-knm.de> 1187532202 +0200
Message:

Ablative Panzerung eingebaut

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • db/tables/ship_types.sql

    rbed664f r4f02618  
    1111  `hull` int(11) NOT NULL default '0', 
    1212  `panzerung` tinyint(3) unsigned NOT NULL default '0', 
     13  `ship_types` ADD `ablativeArmor` INT UNSIGNED NOT NULL default '0', 
    1314  `cargo` int(11) NOT NULL default '0', 
    1415  `heat` int(11) NOT NULL default '0', 
  • db/tables/ships.sql

    r23d6d8b r4f02618  
    1414  `hull` int(11) unsigned NOT NULL default '1', 
    1515  `shields` int(11) unsigned NOT NULL default '0', 
     16  `ablativeArmor` int(11) unsigned NOT NULL default '0', 
    1617  `heat` text NOT NULL, 
    1718  `engine` int(11) NOT NULL default '100', 
  • db/tables/ships_modules.sql

    rbed664f r4f02618  
    1313  `hull` int(11) NOT NULL default '0', 
    1414  `panzerung` tinyint(3) unsigned NOT NULL default '0', 
     15  `ablativeArmor` int(11) unsigned NOT NULL default '0', 
    1516  `cargo` mediumint(8) unsigned NOT NULL default '0', 
    1617  `heat` int(11) NOT NULL default '0', 
  • db/updates.xml

    rfb87868 r4f02618  
    383383                ALTER TABLE `werft_queues` ADD UNIQUE `queueentry` ( `werft` , `position` ); 
    384384        ]]></update> 
     385        <update type="structure" datum="2007-08-19"><![CDATA[ 
     386                ALTER TABLE `ships` ADD `ablativeArmor` INT UNSIGNED NOT NULL AFTER `shields`; 
     387                ALTER TABLE `ship_types` ADD `ablativeArmor` INT UNSIGNED NOT NULL AFTER `panzerung`; 
     388                ALTER TABLE `ships_modules` ADD `ablativeArmor` INT UNSIGNED NOT NULL AFTER `panzerung`; 
     389        ]]></update> 
    385390</updates> 
  • src/net/driftingsouls/ds2/server/SectorTemplateManager.java

    rbbcbceb r4f02618  
    128128                         
    129129                        db.update("INSERT INTO ships ",  
    130                                         " (owner,x,y,system,name,type,cargo,status,crew,e,s,hull,shields,heat,engine,weapons,comm,sensors,docked,alarm,destx,desty,destsystem,destcom,bookmark,jumptarget,autodeut,history) ", 
     130                                        " (owner,x,y,system,name,type,cargo,status,crew,e,s,hull,shields,heat,engine,weapons,comm,sensors,docked,alarm,destx,desty,destsystem,destcom,bookmark,jumptarget,autodeut,history, ablativeArmor) ", 
    131131                                        " VALUES ", 
    132132                                        " ('",owner,"','",newx,"','",newy,"','",location.getSystem(),"','",ship.get("name"),"','",ship.getInt("type"),"','",ship.getString("cargo"),"','",ship.get("status"),"', ", 
     
    135135                                         " '",ship.getInt("sensors"),"','','",ship.getInt("alarm"),"', ", 
    136136                                         " '",ship.getInt("destx"),"','",ship.getInt("desty"),"','",ship.getInt("destsystem"),"','",ship.getString("destcom"),"', ", 
    137                                          " '",ship.getInt("bookmark"),"','",ship.get("jumptarget"),"','",ship.getInt("autodeut"),"','",ship.getString("history"),"')"); 
     137                                         " '",ship.getInt("bookmark"),"','",ship.get("jumptarget"),"','",ship.getInt("autodeut"),"','",ship.getString("history"),"','",ship.getString("ablativeArmor"),"')"); 
    138138                        int shipid = db.insertID(); 
    139139                         
     
    156156                                                "(id,modules,nickname,picture,ru,rd,ra,rm," , 
    157157                                                "eps,cost,hull,panzerung,cargo,heat,crew,weapons,maxheat,torpedodef," , 
    158                                                 "shields,size,jdocks,adocks,sensorrange,hydro,deutfactor,recost,flags,werft,ow_werft) VALUES " , 
     158                                                "shields,size,jdocks,adocks,sensorrange,hydro,deutfactor,recost,flags,werft,ow_werft,ablativeArmor) VALUES " , 
    159159                                                "('",shipid,",'",modules.get("modules"),"','",modules.get("nickname"),"','",modules.get("picture"),"','",modules.get("ru"),"','",modules.get("rd"),"','",modules.get("ra"),"','",modules.get("rm"),"'," , 
    160160                                                "'",modules.get("eps"),"','",modules.get("cost"),"','",modules.get("hull"),"','",modules.get("panzerung"),"','",modules.get("cargo"),"','",modules.get("heat"),"','",modules.get("crew"),"','",modules.get("weapons"),"','",modules.get("maxheat"),"','",modules.get("torpedodef"),"'," , 
    161                                                 "'",modules.get("shields"),"','",modules.get("size"),"','",modules.get("jdocks"),"','",modules.get("adocks"),"','",modules.get("sensorrange"),"','",modules.get("hydro"),"','",modules.get("deutfactor"),"','",modules.get("recost"),"','",modules.get("flags"),"','",modules.get("werft"),"','",modules.get("ow_werft"),"')"); 
     161                                                "'",modules.get("shields"),"','",modules.get("size"),"','",modules.get("jdocks"),"','",modules.get("adocks"),"','",modules.get("sensorrange"),"','",modules.get("hydro"),"','",modules.get("deutfactor"),"','",modules.get("recost"),"','",modules.get("flags"),"','",modules.get("werft"),"','",modules.get("ow_werft"),"','",modules.get("ablativeArmor"),"')"); 
    162162                        } 
    163163                } 
  • src/net/driftingsouls/ds2/server/battles/BattleShip.java

    r8aa1ac6 r4f02618  
    5555        private int count; 
    5656        private int newcount; 
     57        private int ablativeArmor; 
    5758         
    5859        /** 
     
    336337                return ship.getDocked(); 
    337338        } 
    338          
    339          
     339 
     340        /** 
     341         * Gibt die Punkte an ablativer Panzerung zurueck, ueber die das Schiff noch verfuegt 
     342         * @return Die ablative Panzerung 
     343         */ 
     344        public int getAblativeArmor() { 
     345                return ablativeArmor; 
     346        } 
     347 
     348        /** 
     349         * Setzt die ablative Panzerung des Schiffes 
     350         * @param ablativeArmour Der neue Wert der ablativen Panzerung 
     351         */ 
     352        public void setAblativeArmor(int ablativeArmour) { 
     353                this.ablativeArmor = ablativeArmour; 
     354        } 
    340355} 
  • src/net/driftingsouls/ds2/server/modules/ItemInfoController.java

    re1b01c8 r4f02618  
    147147                        colorize(effecttext, mods.getPanzerung()); 
    148148                        effecttext.append("Panzerung "+mods.getPanzerung()); 
     149                        effecttext.append("</span><br />\n"); 
     150                } 
     151                 
     152                if( mods.getAblativeArmor() != 0 ) { 
     153                        colorize(effecttext, mods.getAblativeArmor()); 
     154                        effecttext.append("Ablative Panzerung "+mods.getAblativeArmor()); 
    149155                        effecttext.append("</span><br />\n"); 
    150156                } 
  • src/net/driftingsouls/ds2/server/modules/SchiffController.java

    re1b01c8 r4f02618  
    11251125                moduleOutputList.put("getADocks", "Externe Docks "); 
    11261126                moduleOutputList.put("getJDocks", "J&auml;gerdocks "); 
     1127                moduleOutputList.put("getAblativeArmor", "Ablative Panzerung "); 
    11271128        } 
    11281129         
  • src/net/driftingsouls/ds2/server/modules/SchiffInfoController.java

    r45731ef r4f02618  
    379379                                        "shiptype.hull",                Common.ln(ship.getHull()), 
    380380                                        "shiptype.panzerung",   ship.getPanzerung(), 
     381                                        "shiptype.ablativearmor",       ship.getAblativeArmor(), 
    381382                                        "shiptype.shields",             Common.ln(ship.getShields()), 
    382383                                        "shiptype.deutfactor",  ship.getDeutFactor(), 
  • src/net/driftingsouls/ds2/server/modules/admin/AddShips.java

    rbed664f r4f02618  
    295295                                        } 
    296296                                         
    297                                         query = db.prepare("INSERT INTO ships (id,name,type,owner,x,y,system,hull,e,crew,shields,cargo,history) "+  
     297                                        query = db.prepare("INSERT INTO ships (id,name,type,owner,x,y,system,hull,e,crew,shields,cargo,history,ablativeArmor) "+  
    298298                                                                "VALUES (newIntelliShipID( ? ), ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )"); 
    299                                         query.update(shouldId, name, ship, owner, x, y, system, shiptype.getHull(), shiptype.getEps(), shiptype.getCrew(), shiptype.getShields(), cargo.save(), history); 
     299                                        query.update(shouldId, name, ship, owner, x, y, system, shiptype.getHull(), shiptype.getEps(), shiptype.getCrew(), shiptype.getShields(), cargo.save(), history, shiptype.getAblativeArmor()); 
    300300                                } 
    301301                                else { 
    302                                         query = db.prepare("INSERT INTO ships (name,type,owner,x,y,system,hull,e,crew,shields,cargo,history) "+  
     302                                        query = db.prepare("INSERT INTO ships (name,type,owner,x,y,system,hull,e,crew,shields,cargo,history,ablativeArmor) "+  
    303303                                                                "VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )"); 
    304                                         query.update(name, ship, owner, x, y, system, shiptype.getHull(), shiptype.getEps(), shiptype.getCrew(), shiptype.getShields(), cargo.save(), history); 
     304                                        query.update(name, ship, owner, x, y, system, shiptype.getHull(), shiptype.getEps(), shiptype.getCrew(), shiptype.getShields(), cargo.save(), history, shiptype.getAblativeArmor()); 
    305305                                } 
    306306                                int shipid = query.insertID(); 
     
    374374                                                        } 
    375375                                                         
    376                                                         query = db.prepare("INSERT INTO ships (id,name,type,owner,x,y,system,hull,e,crew,shields,docked,fleet,cargo,history) "+  
     376                                                        query = db.prepare("INSERT INTO ships (id,name,type,owner,x,y,system,hull,e,crew,shields,docked,fleet,cargo,history, ablativeArmor) "+  
    377377                                                                                "VALUES (newIntelliShipID( ? ), ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?, ?, ? )"); 
    378                                                         query.update(shouldId, name+" "+j, jaeger, owner, x, y, system, jshiptype.getHull(), jshiptype.getEps(), jshiptype.getCrew(), jshiptype.getShields(), "l "+shipid, fleetid, jcargo.save(), history); 
     378                                                        query.update(shouldId, name+" "+j, jaeger, owner, x, y, system, jshiptype.getHull(), jshiptype.getEps(), jshiptype.getCrew(), jshiptype.getShields(), "l "+shipid, fleetid, jcargo.save(), history, shiptype.getAblativeArmor()); 
    379379                                                } 
    380380                                                else { 
    381                                                         query = db.prepare("INSERT INTO ships (name,type,owner,x,y,system,hull,e,crew,shields,docked,fleet,cargo,history) "+  
     381                                                        query = db.prepare("INSERT INTO ships (name,type,owner,x,y,system,hull,e,crew,shields,docked,fleet,cargo,history, ablativeArmor) "+  
    382382                                                                                "VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?, ?, ? )"); 
    383                                                         query.update(name+" "+j, jaeger, owner, x, y, system, jshiptype.getHull(), jshiptype.getEps(), jshiptype.getCrew(), jshiptype.getShields(), "l "+shipid, fleetid, jcargo.save(), history); 
     383                                                        query.update(name+" "+j, jaeger, owner, x, y, system, jshiptype.getHull(), jshiptype.getEps(), jshiptype.getCrew(), jshiptype.getShields(), "l "+shipid, fleetid, jcargo.save(), history, shiptype.getAblativeArmor()); 
    384384                                                } 
    385385                                                int insid = query.insertID(); 
  • src/net/driftingsouls/ds2/server/modules/ks/KSAttackAction.java

    r7202f86 r4f02618  
    9696                if( (this.attcount <= 0) || (this.attcount > 3) ) { 
    9797                        this.attcount = 3; 
    98                 }  
    99                                 
     98                } 
     99                 
    100100                this.requireAP(this.weapon.getAPCost()*this.apmulti); 
    101101        } 
     
    436436                        } 
    437437                         
     438                        //Ablative Panzerung pruefen 
     439                        int ablativeArmor = eShip.getAblativeArmor(); 
     440                        if(ablativeArmor > 0) 
     441                        { 
     442                                ablativeArmor -= hulldamage; 
     443                                //Ablative Panzerung von VOR dem Treffer abziehen 
     444                                hulldamage -= eShip.getAblativeArmor(); 
     445                                if(hulldamage < 0) 
     446                                { 
     447                                        hulldamage = 0; 
     448                                } 
     449                                if(ablativeArmor < 0) 
     450                                { 
     451                                        ablativeArmor = 0; 
     452                                } 
     453                        } 
     454                        eShip.setAblativeArmor(0); 
     455                         
    438456                        if( eShipType.hasFlag(ShipTypes.SF_GOD_MODE ) ) { 
    439457                                if( eShip.getHull() - hulldamage < 1 ) { 
     
    460478                                battle.logenemy( "+ H&uuml;lle: "+Common.ln(hulldamage)+" Schaden\n" ); 
    461479         
    462                                 //Subsysteme 
    463                                 if( subdmgs != null && (subdmgs.length > 0) ) { 
     480                                //Subsysteme - nur treffbar, wenn die ablative Panzerung auf 0 ist 
     481                                if( subdmgs != null && (subdmgs.length > 0) && ablativeArmor == 0) { 
    464482                                        final int ENGINE = 0; 
    465483                                        final int WEAPONS = 1; 
  • src/net/driftingsouls/ds2/server/ships/AbstractShipTypeDataWrapper.java

    rbed664f r4f02618  
    208208        } 
    209209         
    210          
     210        public int getAblativeArmor() { 
     211                return inner.getAblativeArmor(); 
     212        } 
    211213} 
  • src/net/driftingsouls/ds2/server/ships/Ship.java

    rad0b636 r4f02618  
    147147        private String onmove; 
    148148        private Byte respawn; 
     149        private int ablativeArmor; 
    149150         
    150151        /** 
     
    892893 
    893894                this.status = Common.implode(" ", status); 
    894                  
     895 
    895896                // Ueberpruefen, ob ein evt vorhandener Werftkomplex nicht exisitert 
    896897                if( type.getWerft() != 0 ) { 
     
    903904                        } 
    904905                } 
    905  
     906                 
    906907                return this.status; 
    907908        } 
     
    11481149                shipModules.setWerft(type.getWerft()); 
    11491150                shipModules.setOneWayWerft(type.getOneWayWerft()); 
     1151                shipModules.setAblativeArmor(type.getAblativeArmor()); 
    11501152        } 
    11511153 
     
    12381240                        shipModules.setWerft(type.getWerft()); 
    12391241                        shipModules.setOneWayWerft(type.getOneWayWerft()); 
     1242                        shipModules.setAblativeArmor(type.getAblativeArmor()); 
    12401243                } 
    12411244                else { 
     
    13311334                shipModules.setWerft(type.getWerft()); 
    13321335                shipModules.setOneWayWerft(type.getOneWayWerft()); 
     1336                shipModules.setAblativeArmor(type.getAblativeArmor()); 
    13331337        } 
    13341338 
     
    32213225                        .iterate().next()).intValue() != 0; 
    32223226        } 
    3223          
    3224         /** 
    3225          * Transfers resources to another object. 
    3226          *  
    3227          * @param to Any object that can transfer/accept transfers. 
    3228          * @param resource Resource that should be transfered. 
    3229          * @param count Amout to be transfered. 
    3230          * @return Informations about the outcome. 
    3231          */ 
    3232         public String transfer(Transfering to, ResourceID resource, long count) { 
     3227 
     3228        public String transfer(Transfering to, ResourceID resource, long count) { 
    32333229                return new Transfer().transfer(this, to, resource, count); 
    32343230        } 
     
    32413237                return getTypeData().getCargo(); 
    32423238        } 
     3239         
     3240        /** 
     3241         * Gibt den Wert der ablativen Panzerung des Schiffes zurueck 
     3242         * @return Der Panzerungswert 
     3243         */ 
     3244        public int getAblativeArmor() { 
     3245                return ablativeArmor; 
     3246        } 
     3247 
     3248        /** 
     3249         * Setzt die ablative Panzerung des Schiffes 
     3250         * @param ablativeArmor Der neue Panzerungswert 
     3251         */ 
     3252        public void setAblativeArmor(int ablativeArmor) { 
     3253                this.ablativeArmor = ablativeArmor; 
     3254        } 
    32433255} 
  • src/net/driftingsouls/ds2/server/ships/ShipModules.java

    rd22e1ce r4f02618  
    7878        @Column(name="ow_werft") 
    7979        private int oneWayWerft; 
     80        private int ablativeArmor; 
    8081         
    8182        /** 
     
    510511                return super.clone(); 
    511512        } 
     513 
     514        public int getAblativeArmor() { 
     515                return ablativeArmor; 
     516        } 
     517 
     518        /** 
     519         * Setzt den Wert der ablativen Panzerung 
     520         * @param ablativeArmor Die ablative Panzerung 
     521         */ 
     522        public void setAblativeArmor(int ablativeArmor) { 
     523                this.ablativeArmor = ablativeArmor; 
     524        } 
    512525} 
  • src/net/driftingsouls/ds2/server/ships/ShipType.java

    rbed664f r4f02618  
    8383        private int shipCount; 
    8484        private boolean hide; 
     85        private int ablativeArmor; 
    8586         
    8687        /** 
     
    267268                throw new CloneNotSupportedException("Diese Klasse ist unveraenderbar"); 
    268269        } 
     270 
     271        public int getAblativeArmor() { 
     272                return ablativeArmor; 
     273        } 
    269274} 
  • src/net/driftingsouls/ds2/server/ships/ShipTypeChangeset.java

    rbed664f r4f02618  
    5353        private int hull; 
    5454        private int panzerung; 
     55        private int ablativeArmor; 
    5556        private long cargo; 
    5657        private int heat; 
     
    164165                                this.panzerung = Integer.parseInt(item.getAttribute("value")); 
    165166                        } 
     167                        else if( name.equals("ablativearmor") ) { 
     168                                this.ablativeArmor = Integer.parseInt(item.getAttribute("value")); 
     169                        } 
    166170                        else if( name.equals("cargo") ) { 
    167171                                this.cargo = Long.parseLong(item.getAttribute("value")); 
     
    333337        public int getPanzerung() { 
    334338                return panzerung; 
     339        } 
     340         
     341        /** 
     342         * Gibt zurueck, um wieviel die ablative Panzerung modifiziert wird 
     343         * @return Die ablative Panzerung 
     344         */ 
     345        public int getAblativeArmor() { 
     346                return this.ablativeArmor; 
    335347        } 
    336348 
     
    855867                        return inner.getType(); 
    856868                } 
     869 
     870                public int getAblativeArmor() { 
     871                        return inner.getAblativeArmor(); 
     872                } 
    857873        } 
    858874} 
  • src/net/driftingsouls/ds2/server/ships/ShipTypeData.java

    rbed664f r4f02618  
    253253         */ 
    254254        public boolean isMilitary(); 
     255         
     256        /** 
     257         * Gibt die ablative Panzerung des Schifftypes zurueck. 
     258         * @return Ablative Panzerung 
     259         */ 
     260        public int getAblativeArmor(); 
    255261         
    256262        /** 
  • src/net/driftingsouls/ds2/server/tick/regular/NPCOrderTick.java

    re87da2b r4f02618  
    173173                                        ship.setComm(100); 
    174174                                        ship.setSensors(100); 
     175                                        ship.setAblativeArmor(shipd.getAblativeArmor()); 
    175176                                         
    176177                                        id = (Integer)db.save(ship); 
  • src/net/driftingsouls/ds2/server/werften/WerftObject.java

    rfb87868 r4f02618  
    506506                } 
    507507                 
     508                if( ship.getAblativeArmor() > shiptype.getAblativeArmor() ) { 
     509                        ship.setAblativeArmor(shiptype.getAblativeArmor()); 
     510                } 
     511                 
    508512                if( ship.getEnergy() > shiptype.getEps() ) { 
    509513                        ship.setEnergy(shiptype.getEps());       
     
    882886                int htr = shiptype.getHull()-ship.getHull(); 
    883887                int htrsub = (int)Math.round(shiptype.getHull()*0.5d); 
     888                int ablativeArmorToRepair = shiptype.getAblativeArmor() - ship.getAblativeArmor(); 
    884889                 
    885890                if( htr > htrsub ) { 
     
    922927                } 
    923928                 
     929                cost.addResource(Resources.URAN, ablativeArmorToRepair/5); 
     930                cost.addResource(Resources.TITAN, ablativeArmorToRepair/5); 
     931                cost.addResource(Resources.ADAMATIUM, ablativeArmorToRepair/10); 
     932                 
    924933                RepairCosts rc = new RepairCosts(); 
    925934                rc.e = energie; 
     
    976985                         
    977986                        this.setEnergy(newe); 
     987                        ship.setAblativeArmor(shiptype.getAblativeArmor()); 
    978988                        ship.setHull(shiptype.getHull()); 
    979989                        ship.setEngine(100); 
  • src/net/driftingsouls/ds2/server/werften/WerftQueueEntry.java

    rfb87868 r4f02618  
    359359                ship.setComm(100); 
    360360                ship.setSensors(100); 
     361                ship.setAblativeArmor(shipd.getAblativeArmor()); 
    361362                 
    362363                int id = (Integer)db.save(ship); 
  • templates/schiffinfo.html

    r45731ef r4f02618  
    144144         
    145145                <br />H&uuml;llenst&auml;rke: {shiptype.hull}<br  /> 
     146                Ablative Panzerung: {shiptype.ablativearmor}<br /> 
    146147                {if shiptype.panzerung}Panzerung: {shiptype.panzerung}<br />{/endif} 
    147148                {if shiptype.shields}