Skip to content

Commit

Permalink
Merge pull request #809 from Dugy/bzb
Browse files Browse the repository at this point in the history
dynamically load most bzb events
  • Loading branch information
white-haired-uncle authored May 25, 2024
2 parents 08ac504 + 4b22048 commit d1abf1a
Show file tree
Hide file tree
Showing 8 changed files with 627 additions and 403 deletions.
160 changes: 160 additions & 0 deletions utils/beelzebub/beelzebub_die.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#textdomain wesnoth-loti
[event]
name=beelzebub_die
[if]
[variable]
equals=yes
name="seen_beelzebub_die"
[/variable]
[then]
[message]
message=_"I shall return again. Much stronger than before. And you will learn what it truly means to suffer."
speaker="unit"
[/message]
[message]
id="Efraim"
message=_"I wonder if there is a way to kill him for good."
[or]
id="Krux"
[/or]
[/message]
[/then]
[else]
[message]
message=_"I will have my revenge! I will rip your hearts out! I will count your ribs! I crack your skulls open and bite off your brain, bit by bit, while you still live! I will chew your guts and listen to your screams!"
speaker="unit"
[/message]
[message]
id="Lethalia"
message=_"How do you want to do it? You are defeated. You will not survive these injuries. You will not survive it because I will be chewing your ribs and ripping your skull out very soon. And the other things."
[or]
id="Vritra"
[/or]
[/message]
[set_variable]
name="seen_beelzebub_die"
value=true
[/set_variable]
[/else]
[/if]
[store_map_dimensions]
variable="map_size"
[/store_map_dimensions]
[set_variable]
name="drop_x"
value="$x1"
[/set_variable]
[set_variable]
name="drop_y"
value="$y1"
[/set_variable]
[set_variable]
name="radius"
value=3
[/set_variable]
[set_variable]
name="drop_min"
value="$radius"
[/set_variable]
[set_variable]
add=1
name="drop_min"
[/set_variable]
[set_variable]
name="drop_max_x"
value="$map_size.width"
[/set_variable]
[set_variable]
name="drop_max_x"
sub=3
[/set_variable]
[set_variable]
name="drop_max_y"
value="$map_size.height"
[/set_variable]
[set_variable]
name="drop_max_y"
sub=3
[/set_variable]
[if]
[variable]
less_than="$drop_min"
name="drop_x"
[/variable]
[then]
[set_variable]
name="drop_x"
value="$drop_min"
[/set_variable]
[/then]
[/if]
[if]
[variable]
greater_than="$drop_max_x"
name="drop_x"
[/variable]
[then]
[set_variable]
name="drop_x"
value="$drop_max_x"
[/set_variable]
[/then]
[/if]
[if]
[variable]
less_than="$drop_min"
name="drop_y"
[/variable]
[then]
[set_variable]
name="drop_y"
value="$drop_min"
[/set_variable]
[/then]
[/if]
[if]
[variable]
greater_than="$drop_max_y"
name="drop_y"
[/variable]
[then]
[set_variable]
name="drop_y"
value="$drop_max_y"
[/set_variable]
[/then]
[/if]
[store_locations]
radius="$radius"
variable="nearby"
x="$drop_x"
y="$drop_y"
[/store_locations]
[random_item]
group="rare_drop"
x="$drop_x"
y="$drop_y"
[/random_item]
[foreach]
array="nearby"
[do]
[random_item]
group="expanded_drop"
x="$this_item.x"
y="$this_item.y"
[types]
armour="armour,armour,armour,helm,boots,gauntlets"
other="amulet,amulet,ring,ring,cloak,cloak,limited,potion,potion,potion,potion,potion,gold,gold,gold,gold"
weapon="axe,axe,staff,sword,sword,knife,bow,xbow,spear,spear,bow,dagger,mace"
[/types]
[/random_item]
[/do]
[/foreach]
[clear_variable]
name="drop_x,drop_y,drop_min,drop_max_x,drop_max_y,radius,map_size,nearby"
[/clear_variable]
[set_variable]
name="saved_turns"
sub=500
[/set_variable]
[/event]
77 changes: 77 additions & 0 deletions utils/beelzebub/see_beelzebub_monument.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#textdomain wesnoth-loti
[event]
name=see_beelzebub_monument
[lua]
code = <<
local finder = wml.variables["unit"]
local have_lethalia = #wesnoth.units.find_on_map{ id = "Lethalia" } == 1
local have_vritra = #wesnoth.units.find_on_map{ id = "Vritra" } == 1
local have_efraim = #wesnoth.units.find_on_map{ id = "Efraim" } == 1
if finder.id ~= "Lethalia" and have_lethalia then
wml.variables["msg_speaker"]="Lethalia"
return
end
if finder.id == "Lethalia" and have_vritra then
wml.variables["msg_speaker"]="Vritra"
return
end
if finder.id == "Lethalia" and not have_vritra and have_efraim then
wml.variables["msg_speaker"]="Efraim"
return
end
if finder.id == "Krux" and have_vritra then
wml.variables["msg_speaker"] = "Vritra"
return
end
wml.variables["msg_speaker"]="Krux"
>>
[/lua]

[if]
[variable]
name=seen_beelzebub_monument
equals=yes
[/variable]
[then]
[message]
speaker=unit
message= _ "Look..."
[/message]
[if]
[variable]
name=seen_beelzebub
equals=yes
[/variable]
[then]
[message]
speaker=$msg_speaker
message= _ "Oh damn. Beelzebub is here again."
[/message]
[/then]
[else]
[message]
speaker=$msg_speaker
message= _ "There's that weird looking stone thing again."
[/message]
[/else]
[/if]
[/then]
[else]
[message]
speaker=unit
message= _ "Look! That stone looks quite weird."
[/message]
[message]
speaker=$msg_speaker
message= _ "Maybe we should investigate."
[/message]
[set_variable]
name=seen_beelzebub_monument
value=yes
[/set_variable]
[/else]
[/if]
[clear_variable]
name=msg_speaker
[/clear_variable]
[/event]
Loading

0 comments on commit d1abf1a

Please sign in to comment.