Added Dynamite tech with Artillery

This commit is contained in:
Yair Morgenstern 2018-06-25 13:59:51 +03:00
parent b166e23858
commit 1dffbe2db5
3 changed files with 20 additions and 2 deletions

View File

@ -329,6 +329,11 @@
name:"Steam Power", name:"Steam Power",
row:7, row:7,
prerequisites:["Industrialization","Scientific Theory","Chemistry"] prerequisites:["Industrialization","Scientific Theory","Chemistry"]
},
{
name:"Dynamite",
row:9,
prerequisites:["Fertilizer"]
} }
] ]
}, },
@ -353,7 +358,7 @@
{ {
name:"Combustion", name:"Combustion",
row:8, row:8,
prerequisites:["Steam Power"] prerequisites:["Steam Power","Dynamite"]
} }
] ]
}, },

View File

@ -249,6 +249,18 @@
}, },
*/ */
{
name:"Artillery",
unitType:"Siege",
movement:2,
strength:21,
rangedStrength:28,
range:3,
cost: 120,
requiredTech:"Dynamite",
uniques:["Bonus vs City 200%","No defensive terrain bonus","Must set up to ranged attack","Limited Visibility"],
hurryCostModifier:20
},
/* Great people */ /* Great people */

View File

@ -96,7 +96,8 @@ class UnitAutomation{
if (enemyTileToAttack != null) { if (enemyTileToAttack != null) {
val enemy = Battle().getMapCombatantOfTile(enemyTileToAttack.tileToAttack)!! val enemy = Battle().getMapCombatantOfTile(enemyTileToAttack.tileToAttack)!!
unit.moveToTile(enemyTileToAttack.tileToAttackFrom) unit.moveToTile(enemyTileToAttack.tileToAttackFrom)
val setupAction = UnitActions().getUnitActions(unit, UnCivGame.Current.worldScreen).firstOrNull{ it.name == "Set up" } val setupAction = UnitActions().getUnitActions(unit, UnCivGame.Current.worldScreen)
.firstOrNull{ it.name == "Set up" }
if(setupAction!=null) setupAction.action() if(setupAction!=null) setupAction.action()
if(unit.currentMovement>0) // This can be 0, if the set up action took away what action points we had left... if(unit.currentMovement>0) // This can be 0, if the set up action took away what action points we had left...
Battle(unit.civInfo.gameInfo).attack(MapUnitCombatant(unit), enemy) Battle(unit.civInfo.gameInfo).attack(MapUnitCombatant(unit), enemy)