mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 20:55:44 +00:00
Add StartBlizzardQuest type (PR 1/3) (#5875)
This commit is contained in:
@@ -53,6 +53,7 @@ message QuestDetails {
|
||||
WinBattleOutnumberedQuest win_battle_outnumbered_quest = 36;
|
||||
WinBattlesQuest win_battles_quest = 37;
|
||||
ApprehendOutlawQuest apprehend_outlaw_quest = 38;
|
||||
StartBlizzardQuest start_blizzard_quest = 39;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,4 +204,8 @@ message WinBattlesQuest {
|
||||
|
||||
message ApprehendOutlawQuest {
|
||||
int32 outlaw_hero_id = 1;
|
||||
}
|
||||
|
||||
message StartBlizzardQuest {
|
||||
int32 province_id = 1;
|
||||
}
|
||||
+4
@@ -24,6 +24,7 @@ import net.eagle0.eagle.model.state.quest.{
|
||||
ReleasePrisonerQuest,
|
||||
RescueImprisonedLeaderQuest,
|
||||
ReturnPrisonerQuest,
|
||||
StartBlizzardQuest,
|
||||
SwearBrotherhoodWithHeroQuest,
|
||||
TruceCountQuest,
|
||||
TruceWithFactionQuest
|
||||
@@ -168,6 +169,9 @@ case class CheckForFailedQuestsAction(
|
||||
!provinces.exists(
|
||||
_.unaffiliatedHeroes.exists(uh => uh.heroId == outlawHeroId && uh.unaffiliatedHeroType == Outlaw)
|
||||
)
|
||||
case _: StartBlizzardQuest =>
|
||||
// Never fails - if a blizzard already exists, quest creation should not offer this
|
||||
false
|
||||
case _ => false
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -40,6 +40,7 @@ import net.eagle0.eagle.model.state.quest.{
|
||||
RescueImprisonedLeaderQuest,
|
||||
ReturnPrisonerQuest,
|
||||
SpecificExpansionQuest,
|
||||
StartBlizzardQuest,
|
||||
SuppressRiotByForceQuest,
|
||||
SwearBrotherhoodWithHeroQuest,
|
||||
TotalDevelopmentQuest,
|
||||
@@ -212,6 +213,8 @@ case class CheckForFulfilledQuestsAction(
|
||||
}
|
||||
case WinBattleOutnumberedQuest =>
|
||||
false // action quest - fulfilled in ResolveBattleAction
|
||||
case _: StartBlizzardQuest =>
|
||||
false // action quest - fulfilled in ControlWeatherCommand
|
||||
// Note: WinBattlesQuest is handled by ComponentQuest case above
|
||||
case _: ApprehendOutlawQuest =>
|
||||
false // action quest - fulfilled in ApprehendOutlawCommand
|
||||
|
||||
+6
@@ -305,6 +305,12 @@ case class DivineMessagePromptGenerator(
|
||||
)
|
||||
} yield s"""$divinedHeroName wants $actingHeroName to apprehend the outlaw $outlawHeroName.
|
||||
|$outlawHeroDescription""".stripMargin
|
||||
|
||||
case StartBlizzardQuest(targetProvinceId) =>
|
||||
val targetProvince = gameState.provinces(targetProvinceId)
|
||||
TextGenerationSuccess(
|
||||
s"$divinedHeroName wants to see a magical blizzard unleashed upon ${targetProvince.name}."
|
||||
)
|
||||
}
|
||||
|
||||
override def generate: TextGenerationResult = for {
|
||||
|
||||
+6
@@ -313,6 +313,12 @@ object QuestEndedGeneratorUtilities {
|
||||
outlawHeroName <- clientTextStore.getText(outlawHero.nameTextId)
|
||||
} yield s"""$unaffiliatedHeroName wanted ${faction.name} to apprehend the outlaw $outlawHeroName.
|
||||
|$outlawHeroDescription""".stripMargin
|
||||
|
||||
case StartBlizzardQuest(targetProvinceId) =>
|
||||
val targetProvince = gameState.provinces(targetProvinceId)
|
||||
for {
|
||||
unaffiliatedHeroName <- unaffiliatedHeroNameResult
|
||||
} yield s"$unaffiliatedHeroName wanted to see a magical blizzard unleashed upon ${targetProvince.name}."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.eagle0.eagle.common.unaffiliated_hero_quest.{
|
||||
RescueImprisonedLeaderQuest as RescueImprisonedLeaderQuestProto,
|
||||
ReturnPrisonerQuest as ReturnPrisonerQuestProto,
|
||||
SpecificExpansionQuest as SpecificExpansionQuestProto,
|
||||
StartBlizzardQuest as StartBlizzardQuestProto,
|
||||
SuppressRiotByForceQuest as SuppressRiotByForceQuestProto,
|
||||
SwearBrotherhoodWithHeroQuest as SwearBrotherhoodWithHeroQuestProto,
|
||||
TotalDevelopmentQuest as TotalDevelopmentQuestProto,
|
||||
@@ -206,6 +207,8 @@ object QuestConverter {
|
||||
)
|
||||
case q: ApprehendOutlawQuest =>
|
||||
QuestProto(details = ApprehendOutlawQuestProto(q.outlawHeroId))
|
||||
case q: StartBlizzardQuest =>
|
||||
QuestProto(details = StartBlizzardQuestProto(q.provinceId))
|
||||
}
|
||||
|
||||
def fromProto(questProto: QuestProto): Quest =
|
||||
@@ -395,6 +398,8 @@ object QuestConverter {
|
||||
_ /* unknownFieldSet */
|
||||
) =>
|
||||
ApprehendOutlawQuest(outlawHeroId)
|
||||
case StartBlizzardQuestProto(provinceId, _ /* unknownFieldSet */ ) =>
|
||||
StartBlizzardQuest(provinceId)
|
||||
case QuestDetailsProto.Empty =>
|
||||
throw new IllegalArgumentException("Empty quest details")
|
||||
}
|
||||
|
||||
@@ -168,3 +168,5 @@ case class WinBattlesQuest(
|
||||
}
|
||||
|
||||
case class ApprehendOutlawQuest(outlawHeroId: HeroId) extends Quest
|
||||
|
||||
case class StartBlizzardQuest(provinceId: ProvinceId) extends Quest
|
||||
|
||||
Reference in New Issue
Block a user