mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 01:15:43 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8a7992eb0 | ||
|
|
03b864b1e3 |
+2
-13
@@ -19,15 +19,10 @@ import net.eagle0.eagle.model.state.{
|
||||
MovingArmy,
|
||||
Supplies
|
||||
}
|
||||
import net.eagle0.util.hero_generation.LoadedHero
|
||||
|
||||
object RequestBattlesAction {
|
||||
|
||||
/** Hero IDs used for tutorial reinforcements. These are hardcoded to avoid conflicts with regular hero IDs. */
|
||||
val TutorialReinforcementHeroIds: Set[Int] = Set(100, 101)
|
||||
|
||||
/** Name text ID for Ikhaan Tarn, who is the only unit that can flee in the tutorial battle */
|
||||
val TarnNameTextId: String = LoadedHero.nameTextId("Ikhaan Tarn")
|
||||
}
|
||||
import net.eagle0.eagle.model.state.battalion.BattalionT
|
||||
import net.eagle0.eagle.model.state.faction.FactionT
|
||||
@@ -105,14 +100,8 @@ case class RequestBattlesAction(
|
||||
if gameType == GameType.Tutorial then RequestBattlesAction.TutorialReinforcementHeroIds
|
||||
else Set.empty[Int]
|
||||
|
||||
// For tutorial games, only Ikhaan Tarn can flee - all other units cannot
|
||||
val canFleeHeroIds =
|
||||
if gameType == GameType.Tutorial then
|
||||
heroes.values
|
||||
.find(_.nameTextId == RequestBattlesAction.TarnNameTextId)
|
||||
.map(_.id)
|
||||
.toSet
|
||||
else Set.empty[Int]
|
||||
// For tutorial games, no units can flee
|
||||
val canFleeHeroIds = Set.empty[Int]
|
||||
|
||||
ActionResultC(
|
||||
actionResultType = StartBattle,
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ object TutorialGameCreation {
|
||||
provinceOrders = ProvinceOrderTypeConverter.fromProto(po.orders),
|
||||
gold = po.gold,
|
||||
food = po.food,
|
||||
support = if po.support > 0 then po.support else baseProvince.support,
|
||||
support = po.support,
|
||||
economy = if po.economy > 0 then po.economy else baseProvince.economy,
|
||||
agriculture = if po.agriculture > 0 then po.agriculture else baseProvince.agriculture,
|
||||
infrastructure = if po.infrastructure > 0 then po.infrastructure else baseProvince.infrastructure
|
||||
|
||||
Reference in New Issue
Block a user