Skip to content

Commit

Permalink
* Re-use some battle music for siege music + add "oh shit, elves!" ta…
Browse files Browse the repository at this point in the history
…ctic to formations AI (disallow defensive stance if enemy are elves)
  • Loading branch information
khamukkamu committed Apr 13, 2018
1 parent 641c01c commit 63b7590
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 18 deletions.
8 changes: 4 additions & 4 deletions ModuleSystem/module_music.py
Expand Up @@ -32,10 +32,10 @@


#TLD battle music
("TLD_Battle_Barding", "Battle/TLD_Battle_Barding.mp3", mtf_module_track, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Beorn", "Battle/TLD_Battle_Beorn.mp3", mtf_module_track, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Corsair", "Battle/TLD_Battle_Corsair.mp3", mtf_module_track, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Dunland", "Battle/TLD_Battle_Dunland.mp3", mtf_module_track, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Barding", "Battle/TLD_Battle_Barding.mp3", mtf_module_track|mtf_sit_siege|mtf_culture_good, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Beorn", "Battle/TLD_Battle_Beorn.mp3", mtf_module_track|mtf_sit_siege|mtf_culture_good, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Corsair", "Battle/TLD_Battle_Corsair.mp3", mtf_module_track|mtf_sit_siege|mtf_culture_evil, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Dunland", "Battle/TLD_Battle_Dunland.mp3", mtf_module_track|mtf_sit_siege|mtf_culture_evil, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Dwarves", "Battle/TLD_Battle_Dwarves.mp3", mtf_module_track, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Elves", "Battle/TLD_Battle_Elves.mp3", mtf_module_track, mtf_sit_fight|mtf_sit_ambushed),
("TLD_Battle_Wood_Elves","Battle/TLD_Battle_WoodElves.mp3", mtf_module_track, mtf_sit_fight|mtf_sit_ambushed),
Expand Down
24 changes: 24 additions & 0 deletions ModuleSystem/module_scripts_form.py
Expand Up @@ -49,6 +49,24 @@
(store_script_param, ":rel_army_size", 2),
(store_script_param, ":battle_presence", 3),
(call_script, "script_battlegroup_get_size", ":team_no", grc_archers),

#Shit, Elves! Tactic - kham
(store_faction_of_party, ":ally_elf", "$g_ally_party"),
(store_faction_of_party, ":enemy_elf", "$g_enemy_party"),
(store_faction_of_party, ":player_elf", "p_main_party"),
(team_get_leader, ":elf_leader", ":team_no"),
(agent_get_troop_id, ":agent_troop", ":elf_leader"),
(store_troop_faction, ":team_is_elf", ":agent_troop"),
(assign, ":shit_elves", 0),
(try_begin),
(this_or_next|is_between, ":ally_elf", "fac_lorien", "fac_dale"),
(is_between, ":player_elf", "fac_lorien","fac_dale"),
(assign, ":shit_elves", 1),
(else_try),
(is_between, ":enemy_elf", "fac_lorien","fac_dale"),
(assign, ":shit_elves", 1),
(try_end),

(try_begin),
(gt, reg0, 0),
(call_script, "script_battlegroup_get_position", Archers_Pos, ":team_no", grc_archers),
Expand Down Expand Up @@ -110,11 +128,15 @@
(lt, ":decision_index", Hold_Point), #probably coming from a defensive position (see below)
(gt, ":distance_to_enemy", AI_firing_distance),
(eq, "$FormAI_AI_no_defense", 0), #player hasn't set disallow defense option?
(this_or_next|is_between, ":team_is_elf", "fac_lorien", "fac_dale"),
(eq, ":shit_elves", 0), #There are no elven teams
(assign, ":move_archers", 1),
(try_end),
(else_try),
(this_or_next|eq, "$FormAI_AI_no_defense", 0), #player hasn't set disallow defense option OR?
(ge, ":decision_index", Hold_Point), #not starting in a defensive position (see below)
(this_or_next|is_between, ":team_is_elf", "fac_lorien", "fac_dale"),
(eq, ":shit_elves", 0), #There are no elven teams
(call_script, "script_battlegroup_get_size", ":team_no", grc_infantry),
(try_begin),
(this_or_next|eq, reg0, 0),
Expand Down Expand Up @@ -148,6 +170,8 @@
(try_begin),
(lt, ":decision_index", Hold_Point), #outnumbered?
(eq, "$FormAI_AI_no_defense", 0), #player hasn't set disallow defense option?
(this_or_next|is_between, ":team_is_elf", "fac_lorien", "fac_dale"),
(eq, ":shit_elves", 0), #There are no elven teams
(lt, "$battle_phase", BP_Fight),
(store_div, ":distance_to_move", ":distance_to_enemy", 6), #middle of rear third of battlefield
(assign, ":hill_search_radius", ":distance_to_move"),
Expand Down
8 changes: 4 additions & 4 deletions _wb/music.txt
Expand Up @@ -8,10 +8,10 @@ defeated_by_neutral_2.ogg 33024 33024
defeated_by_neutral_3.ogg 33024 33024
killed_by_swadian.ogg 33035 33035
TLD_Killed.mp3 268468532 268468532
Battle/TLD_Battle_Barding.mp3 268435456 268440576
Battle/TLD_Battle_Beorn.mp3 268435456 268440576
Battle/TLD_Battle_Corsair.mp3 268435456 268440576
Battle/TLD_Battle_Dunland.mp3 268435456 268440576
Battle/TLD_Battle_Barding.mp3 268697611 268702731
Battle/TLD_Battle_Beorn.mp3 268697611 268702731
Battle/TLD_Battle_Corsair.mp3 268697652 268702772
Battle/TLD_Battle_Dunland.mp3 268697652 268702772
Battle/TLD_Battle_Dwarves.mp3 268435456 268440576
Battle/TLD_Battle_Elves.mp3 268435456 268440576
Battle/TLD_Battle_WoodElves.mp3 268435456 268440576
Expand Down
2 changes: 1 addition & 1 deletion _wb/scripts.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _wb/variable_uses.txt
Expand Up @@ -135,8 +135,8 @@
4
854
1
51
27
52
28
3
10
4
Expand Down
8 changes: 4 additions & 4 deletions music.txt
Expand Up @@ -8,10 +8,10 @@ defeated_by_neutral_2.ogg 33024 33024
defeated_by_neutral_3.ogg 33024 33024
killed_by_swadian.ogg 33035 33035
TLD_Killed.mp3 268468532 268468532
Battle/TLD_Battle_Barding.mp3 268435456 268440576
Battle/TLD_Battle_Beorn.mp3 268435456 268440576
Battle/TLD_Battle_Corsair.mp3 268435456 268440576
Battle/TLD_Battle_Dunland.mp3 268435456 268440576
Battle/TLD_Battle_Barding.mp3 268697611 268702731
Battle/TLD_Battle_Beorn.mp3 268697611 268702731
Battle/TLD_Battle_Corsair.mp3 268697652 268702772
Battle/TLD_Battle_Dunland.mp3 268697652 268702772
Battle/TLD_Battle_Dwarves.mp3 268435456 268440576
Battle/TLD_Battle_Elves.mp3 268435456 268440576
Battle/TLD_Battle_WoodElves.mp3 268435456 268440576
Expand Down
2 changes: 1 addition & 1 deletion scripts.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions variable_uses.txt
Expand Up @@ -135,8 +135,8 @@
4
854
1
51
27
52
28
3
10
4
Expand Down

0 comments on commit 63b7590

Please sign in to comment.