Changeset 4f02618e7c8717451f2d3eda9e7d72daf17f36ca
- Timestamp:
- 08/19/07 16:03:22 (1 year ago)
- git-parent:
- Files:
-
- db/tables/ship_types.sql (modified) (1 diff)
- db/tables/ships.sql (modified) (1 diff)
- db/tables/ships_modules.sql (modified) (1 diff)
- db/updates.xml (modified) (1 diff)
- src/net/driftingsouls/ds2/server/SectorTemplateManager.java (modified) (3 diffs)
- src/net/driftingsouls/ds2/server/battles/BattleShip.java (modified) (2 diffs)
- src/net/driftingsouls/ds2/server/modules/ItemInfoController.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/modules/SchiffController.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/modules/SchiffInfoController.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/modules/admin/AddShips.java (modified) (2 diffs)
- src/net/driftingsouls/ds2/server/modules/ks/KSAttackAction.java (modified) (3 diffs)
- src/net/driftingsouls/ds2/server/ships/AbstractShipTypeDataWrapper.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/ships/Ship.java (modified) (8 diffs)
- src/net/driftingsouls/ds2/server/ships/ShipModules.java (modified) (2 diffs)
- src/net/driftingsouls/ds2/server/ships/ShipType.java (modified) (2 diffs)
- src/net/driftingsouls/ds2/server/ships/ShipTypeChangeset.java (modified) (4 diffs)
- src/net/driftingsouls/ds2/server/ships/ShipTypeData.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/tick/regular/NPCOrderTick.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/werften/WerftObject.java (modified) (4 diffs)
- src/net/driftingsouls/ds2/server/werften/WerftQueueEntry.java (modified) (1 diff)
- templates/schiffinfo.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
db/tables/ship_types.sql
rbed664f r4f02618 11 11 `hull` int(11) NOT NULL default '0', 12 12 `panzerung` tinyint(3) unsigned NOT NULL default '0', 13 `ship_types` ADD `ablativeArmor` INT UNSIGNED NOT NULL default '0', 13 14 `cargo` int(11) NOT NULL default '0', 14 15 `heat` int(11) NOT NULL default '0', db/tables/ships.sql
r23d6d8b r4f02618 14 14 `hull` int(11) unsigned NOT NULL default '1', 15 15 `shields` int(11) unsigned NOT NULL default '0', 16 `ablativeArmor` int(11) unsigned NOT NULL default '0', 16 17 `heat` text NOT NULL, 17 18 `engine` int(11) NOT NULL default '100', db/tables/ships_modules.sql
rbed664f r4f02618 13 13 `hull` int(11) NOT NULL default '0', 14 14 `panzerung` tinyint(3) unsigned NOT NULL default '0', 15 `ablativeArmor` int(11) unsigned NOT NULL default '0', 15 16 `cargo` mediumint(8) unsigned NOT NULL default '0', 16 17 `heat` int(11) NOT NULL default '0', db/updates.xml
rfb87868 r4f02618 383 383 ALTER TABLE `werft_queues` ADD UNIQUE `queueentry` ( `werft` , `position` ); 384 384 ]]></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> 385 390 </updates> src/net/driftingsouls/ds2/server/SectorTemplateManager.java
rbbcbceb r4f02618 128 128 129 129 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) ", 131 131 " VALUES ", 132 132 " ('",owner,"','",newx,"','",newy,"','",location.getSystem(),"','",ship.get("name"),"','",ship.getInt("type"),"','",ship.getString("cargo"),"','",ship.get("status"),"', ", … … 135 135 " '",ship.getInt("sensors"),"','','",ship.getInt("alarm"),"', ", 136 136 " '",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"),"')"); 138 138 int shipid = db.insertID(); 139 139 … … 156 156 "(id,modules,nickname,picture,ru,rd,ra,rm," , 157 157 "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 " , 159 159 "('",shipid,",'",modules.get("modules"),"','",modules.get("nickname"),"','",modules.get("picture"),"','",modules.get("ru"),"','",modules.get("rd"),"','",modules.get("ra"),"','",modules.get("rm"),"'," , 160 160 "'",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"),"')"); 162 162 } 163 163 } src/net/driftingsouls/ds2/server/battles/BattleShip.java
r8aa1ac6 r4f02618 55 55 private int count; 56 56 private int newcount; 57 private int ablativeArmor; 57 58 58 59 /** … … 336 337 return ship.getDocked(); 337 338 } 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 } 340 355 } src/net/driftingsouls/ds2/server/modules/ItemInfoController.java
re1b01c8 r4f02618 147 147 colorize(effecttext, mods.getPanzerung()); 148 148 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()); 149 155 effecttext.append("</span><br />\n"); 150 156 } src/net/driftingsouls/ds2/server/modules/SchiffController.java
re1b01c8 r4f02618 1125 1125 moduleOutputList.put("getADocks", "Externe Docks "); 1126 1126 moduleOutputList.put("getJDocks", "Jägerdocks "); 1127 moduleOutputList.put("getAblativeArmor", "Ablative Panzerung "); 1127 1128 } 1128 1129 src/net/driftingsouls/ds2/server/modules/SchiffInfoController.java
r45731ef r4f02618 379 379 "shiptype.hull", Common.ln(ship.getHull()), 380 380 "shiptype.panzerung", ship.getPanzerung(), 381 "shiptype.ablativearmor", ship.getAblativeArmor(), 381 382 "shiptype.shields", Common.ln(ship.getShields()), 382 383 "shiptype.deutfactor", ship.getDeutFactor(), src/net/driftingsouls/ds2/server/modules/admin/AddShips.java
rbed664f r4f02618 295 295 } 296 296 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) "+ 298 298 "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()); 300 300 } 301 301 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) "+ 303 303 "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()); 305 305 } 306 306 int shipid = query.insertID(); … … 374 374 } 375 375 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) "+ 377 377 "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()); 379 379 } 380 380 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) "+ 382 382 "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()); 384 384 } 385 385 int insid = query.insertID(); src/net/driftingsouls/ds2/server/modules/ks/KSAttackAction.java
r7202f86 r4f02618 96 96 if( (this.attcount <= 0) || (this.attcount > 3) ) { 97 97 this.attcount = 3; 98 } 99 98 } 99 100 100 this.requireAP(this.weapon.getAPCost()*this.apmulti); 101 101 } … … 436 436 } 437 437 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 438 456 if( eShipType.hasFlag(ShipTypes.SF_GOD_MODE ) ) { 439 457 if( eShip.getHull() - hulldamage < 1 ) { … … 460 478 battle.logenemy( "+ Hülle: "+Common.ln(hulldamage)+" Schaden\n" ); 461 479 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) { 464 482 final int ENGINE = 0; 465 483 final int WEAPONS = 1; src/net/driftingsouls/ds2/server/ships/AbstractShipTypeDataWrapper.java
rbed664f r4f02618 208 208 } 209 209 210 210 public int getAblativeArmor() { 211 return inner.getAblativeArmor(); 212 } 211 213 } src/net/driftingsouls/ds2/server/ships/Ship.java
rad0b636 r4f02618 147 147 private String onmove; 148 148 private Byte respawn; 149 private int ablativeArmor; 149 150 150 151 /** … … 892 893 893 894 this.status = Common.implode(" ", status); 894 895 895 896 // Ueberpruefen, ob ein evt vorhandener Werftkomplex nicht exisitert 896 897 if( type.getWerft() != 0 ) { … … 903 904 } 904 905 } 905 906 906 907 return this.status; 907 908 } … … 1148 1149 shipModules.setWerft(type.getWerft()); 1149 1150 shipModules.setOneWayWerft(type.getOneWayWerft()); 1151 shipModules.setAblativeArmor(type.getAblativeArmor()); 1150 1152 } 1151 1153 … … 1238 1240 shipModules.setWerft(type.getWerft()); 1239 1241 shipModules.setOneWayWerft(type.getOneWayWerft()); 1242 shipModules.setAblativeArmor(type.getAblativeArmor()); 1240 1243 } 1241 1244 else { … … 1331 1334 shipModules.setWerft(type.getWerft()); 1332 1335 shipModules.setOneWayWerft(type.getOneWayWerft()); 1336 shipModules.setAblativeArmor(type.getAblativeArmor()); 1333 1337 } 1334 1338 … … 3221 3225 .iterate().next()).intValue() != 0; 3222 3226 } 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) { 3233 3229 return new Transfer().transfer(this, to, resource, count); 3234 3230 } … … 3241 3237 return getTypeData().getCargo(); 3242 3238 } 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 } 3243 3255 } src/net/driftingsouls/ds2/server/ships/ShipModules.java
rd22e1ce r4f02618 78 78 @Column(name="ow_werft") 79 79 private int oneWayWerft; 80 private int ablativeArmor; 80 81 81 82 /** … … 510 511 return super.clone(); 511 512 } 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 } 512 525 } src/net/driftingsouls/ds2/server/ships/ShipType.java
rbed664f r4f02618 83 83 private int shipCount; 84 84 private boolean hide; 85 private int ablativeArmor; 85 86 86 87 /** … … 267 268 throw new CloneNotSupportedException("Diese Klasse ist unveraenderbar"); 268 269 } 270 271 public int getAblativeArmor() { 272 return ablativeArmor; 273 } 269 274 } src/net/driftingsouls/ds2/server/ships/ShipTypeChangeset.java
rbed664f r4f02618 53 53 private int hull; 54 54 private int panzerung; 55 private int ablativeArmor; 55 56 private long cargo; 56 57 private int heat; … … 164 165 this.panzerung = Integer.parseInt(item.getAttribute("value")); 165 166 } 167 else if( name.equals("ablativearmor") ) { 168 this.ablativeArmor = Integer.parseInt(item.getAttribute("value")); 169 } 166 170 else if( name.equals("cargo") ) { 167 171 this.cargo = Long.parseLong(item.getAttribute("value")); … … 333 337 public int getPanzerung() { 334 338 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; 335 347 } 336 348 … … 855 867 return inner.getType(); 856 868 } 869 870 public int getAblativeArmor() { 871 return inner.getAblativeArmor(); 872 } 857 873 } 858 874 } src/net/driftingsouls/ds2/server/ships/ShipTypeData.java
rbed664f r4f02618 253 253 */ 254 254 public boolean isMilitary(); 255 256 /** 257 * Gibt die ablative Panzerung des Schifftypes zurueck. 258 * @return Ablative Panzerung 259 */ 260 public int getAblativeArmor(); 255 261 256 262 /** src/net/driftingsouls/ds2/server/tick/regular/NPCOrderTick.java
re87da2b r4f02618 173 173 ship.setComm(100); 174 174 ship.setSensors(100); 175 ship.setAblativeArmor(shipd.getAblativeArmor()); 175 176 176 177 id = (Integer)db.save(ship); src/net/driftingsouls/ds2/server/werften/WerftObject.java
rfb87868 r4f02618 506 506 } 507 507 508 if( ship.getAblativeArmor() > shiptype.getAblativeArmor() ) { 509 ship.setAblativeArmor(shiptype.getAblativeArmor()); 510 } 511 508 512 if( ship.getEnergy() > shiptype.getEps() ) { 509 513 ship.setEnergy(shiptype.getEps()); … … 882 886 int htr = shiptype.getHull()-ship.getHull(); 883 887 int htrsub = (int)Math.round(shiptype.getHull()*0.5d); 888 int ablativeArmorToRepair = shiptype.getAblativeArmor() - ship.getAblativeArmor(); 884 889 885 890 if( htr > htrsub ) { … … 922 927 } 923 928 929 cost.addResource(Resources.URAN, ablativeArmorToRepair/5); 930 cost.addResource(Resources.TITAN, ablativeArmorToRepair/5); 931 cost.addResource(Resources.ADAMATIUM, ablativeArmorToRepair/10); 932 924 933 RepairCosts rc = new RepairCosts(); 925 934 rc.e = energie; … … 976 985 977 986 this.setEnergy(newe); 987 ship.setAblativeArmor(shiptype.getAblativeArmor()); 978 988 ship.setHull(shiptype.getHull()); 979 989 ship.setEngine(100); src/net/driftingsouls/ds2/server/werften/WerftQueueEntry.java
rfb87868 r4f02618 359 359 ship.setComm(100); 360 360 ship.setSensors(100); 361 ship.setAblativeArmor(shipd.getAblativeArmor()); 361 362 362 363 int id = (Integer)db.save(ship); templates/schiffinfo.html
r45731ef r4f02618 144 144 145 145 <br />Hüllenstärke: {shiptype.hull}<br /> 146 Ablative Panzerung: {shiptype.ablativearmor}<br /> 146 147 {if shiptype.panzerung}Panzerung: {shiptype.panzerung}<br />{/endif} 147 148 {if shiptype.shields}
