NR: Allow to choose whether the Rod of Justice...

...should be picked up by the current unit (bug #16858)

Note that it's not a bug that any unit (except Abhai) can pick it up.
The comments in the code explicitly state this.
This commit is contained in:
Ignacio R. Morelle 2010-10-24 18:41:59 +00:00
parent 7f77f59fd0
commit 916c5c0dc8
3 changed files with 167 additions and 121 deletions

View file

@ -11,6 +11,9 @@ Version 1.9.1+svn:
* Bug fix for the fleeing orcs in scenario 07.
* Liberty:
* New (unanimated) sprites for the Rogue Mage unit line.
* Northern Rebirth:
* Make it possible to choose whether a unit should pick up the
Rod of Justice or not.
* Editor:
* Verbose terrain names can be specified using terrain.editor_name to
be displayed in the editor as "<verbose name>/<common name> (<underlying>)"

View file

@ -4,7 +4,7 @@
# Set up map, TOD scheudle, variables, place images, objects, units, execute start event
# Leads the story to the crossroads
#! -- Sets variables:
# $back_door_opened, $main_door_opened, $spider_door_opened, $confronted_malifor, $treasury_alerted
# $back_door_opened, $main_door_opened, $spider_door_opened, $confronted_malifor, $treasury_alerted, $got_rod_of_justice
id=05a_The_Pursuit
name= _ "The Pursuit"
map_data="{campaigns/Northern_Rebirth/maps/05a_The_Pursuit.map}"
@ -280,6 +280,7 @@
{VARIABLE spider_door_opened no}
{VARIABLE confronted_malifor no}
{VARIABLE treasury_alerted no}
{VARIABLE got_rod_of_justice no}
[/event]
[event]
@ -1601,13 +1602,13 @@
name=moveto
[filter]
side=1
x=3
y=7
id=Abhai
x,y=3,7
[/filter]
[if]
[variable]
name=unit.id
equals=Abhai
name=got_rod_of_justice
boolean_equals=no
[/variable]
[then]
{INCIDENTAL_MUSIC "sad.ogg"}
@ -1644,125 +1645,163 @@
message= _ "Very well."
[/message]
[/then]
[else]
[/if]
[/event]
[event]
first_time_only=no
name=moveto
[filter]
side=1
x,y=3,7
[not]
id=Abhai
[/not]
[/filter]
[if]
[variable]
name=got_rod_of_justice
boolean_equals=no
[/variable]
[then]
[message]
speaker=unit
message= _ "Wow! This thing is... incredible!"
[/message]
[message]
speaker=unit
message= _ "I wonder what such a powerful artifact is doing hidden all the way back here..."
[/message]
[if]
[have_unit]
id=Camerin
[/have_unit]
[then]
[message]
speaker=Camerin
message= _ "Thats... thats the Rod of Justice!"
[/message]
[message]
speaker=Tallin
message= _ "Do you know anything about it, Camerin?"
[/message]
[message]
speaker=Camerin
message= _ "I dont think there is a person alive who knows anything more solid than rumors and legends. There are very few people who even knows it exists!"
[/message]
[message]
speaker=Tallin
message= _ "How did you come to know of it?"
[/message]
[message]
speaker=Camerin
message= _ "Some of the most ancient elvish legends make some vague mention of this artifact. But beyond that..."
[/message]
[message]
speaker=Tallin
message= _ "Interesting. I wonder who — or what — could have created such a powerful artifact. There must be one heck of a story behind this thing."
[/message]
[/then]
[/if]
# Remove the icon
[remove_item]
x=3
y=7
[/remove_item]
# Apply the effects
[object]
id=justice_rod
name= _ "Rod of Justice"
image=attacks/staff-magic.png
duration=forever
description= _ "This is a magical staff of tremendous power and unknown origin. Although the full extent of its power has not been fathomed, there are a few features about it that will be obvious to any master of lore. The wielder of this staff gains a dramatic increase in strength, speed and intelligence, and is granted the ability to fire devastating lightning bolts at at his opponents. Only a person who is good at heart and who is willing to sacrifice his life on the path of justice can wield this staff."
[filter]
id=$unit.id
[/filter]
# New 16-4 fire attack with cool lightning animation
[effect]
apply_to=new_attack
name=rod of justice
description= _ "rod of justice"
type=fire
range=ranged
damage=16
number=4
icon=attacks/lightning.png
[/effect]
# The cool animation mentioned above, a copypasted
# fragment from Delfador's attack
[effect]
apply_to=new_animation
[attack_anim]
[filter_attack]
name=rod of justice
[/filter_attack]
{LIGHTNING_BOLT 1}
speaker=narrator
image=items/staff.png
message= _ "Should this unit pick up the Rod of Justice?"
[option]
message= _ "Take it"
[command]
[message]
speaker=unit
message= _ "Wow! This thing is... incredible!"
[/message]
[message]
speaker=unit
message= _ "I wonder what such a powerful artifact is doing hidden all the way back here..."
[/message]
[if]
hits=no
[frame]
begin=-200
end=0
sound=lightning-miss.ogg
[/frame]
[have_unit]
id=Camerin
[/have_unit]
[then]
[message]
speaker=Camerin
message= _ "Thats... thats the Rod of Justice!"
[/message]
[message]
speaker=Tallin
message= _ "Do you know anything about it, Camerin?"
[/message]
[message]
speaker=Camerin
message= _ "I dont think there is a person alive who knows anything more solid than rumors and legends. There are very few people who even knows it exists!"
[/message]
[message]
speaker=Tallin
message= _ "How did you come to know of it?"
[/message]
[message]
speaker=Camerin
message= _ "Some of the most ancient elvish legends make some vague mention of this artifact. But beyond that..."
[/message]
[message]
speaker=Tallin
message= _ "Interesting. I wonder who — or what — could have created such a powerful artifact. There must be one heck of a story behind this thing."
[/message]
[/then]
[/if]
[else]
hits=yes
[frame]
begin=-200
end=0
sound=lightning.ogg
[/frame]
[/else]
[/attack_anim]
[/effect]
# Increase the movement by 2
[effect]
apply_to=movement
increase=2
[/effect]
# If the unit has melee attacks, increase the damage of
# all of them by two
[effect]
apply_to=attack
range=melee
increase_damage=2
[/effect]
# Give the unit additional 10 HP and heal it
[effect]
apply_to=hitpoints
increase_total=10
heal_full=yes
[/effect]
# Reduce the amount of experience required for next level
# by 20%
[effect]
apply_to=max_experience
increase=-20%
[/effect]
[/object]
[/else]
# Remove the icon
[remove_item]
x=3
y=7
[/remove_item]
# Apply the effects
[object]
id=justice_rod
name= _ "Rod of Justice"
image=attacks/staff-magic.png
duration=forever
description= _ "This is a magical staff of tremendous power and unknown origin. Although the full extent of its power has not been fathomed, there are a few features about it that will be obvious to any master of lore. The wielder of this staff gains a dramatic increase in strength, speed and intelligence, and is granted the ability to fire devastating lightning bolts at at his opponents. Only a person who is good at heart and who is willing to sacrifice his life on the path of justice can wield this staff."
[filter]
id=$unit.id
[/filter]
# New 16-4 fire attack with cool lightning animation
[effect]
apply_to=new_attack
name=rod of justice
description= _ "rod of justice"
type=fire
range=ranged
damage=16
number=4
icon=attacks/lightning.png
[/effect]
# The cool animation mentioned above, a copypasted
# fragment from Delfador's attack
[effect]
apply_to=new_animation
[attack_anim]
[filter_attack]
name=rod of justice
[/filter_attack]
{LIGHTNING_BOLT 1}
[if]
hits=no
[frame]
begin=-200
end=0
sound=lightning-miss.ogg
[/frame]
[/if]
[else]
hits=yes
[frame]
begin=-200
end=0
sound=lightning.ogg
[/frame]
[/else]
[/attack_anim]
[/effect]
# Increase the movement by 2
[effect]
apply_to=movement
increase=2
[/effect]
# If the unit has melee attacks, increase the damage of
# all of them by two
[effect]
apply_to=attack
range=melee
increase_damage=2
[/effect]
# Give the unit additional 10 HP and heal it
[effect]
apply_to=hitpoints
increase_total=10
heal_full=yes
[/effect]
# Reduce the amount of experience required for next level
# by 20%
[effect]
apply_to=max_experience
increase=-20%
[/effect]
[/object]
{VARIABLE got_rod_of_justice yes}
[/command]
[/option]
[option]
message= _ "Leave it"
[command]
[allow_undo]
[/allow_undo]
[/command]
[/option]
[/message]
[/then]
[/if]
[/event]
@ -2989,6 +3028,7 @@
{CLEAR_VARIABLE confronted_malifor}
{CLEAR_VARIABLE treasury_alerted}
{CLEAR_VARIABLE chamber_of_death}
{CLEAR_VARIABLE got_rod_of_justice}
[/event]
# And the usual batch of hero death macros

View file

@ -12,6 +12,9 @@ Version 1.9.1+svn:
* Added extra keeps to keep up with the growing number of leaders.
* Liberty:
* New (unanimated) sprites for the Rogue Mage unit line.
* Northern Rebirth:
* Make it possible to choose whether a unit should pick up the
Rod of Justice or not.
* Graphics:
* Terrain: