Added a way to specify a message for units that can't pick up the item.
This commit is contained in:
parent
f4e9115306
commit
b58f95fdff
1 changed files with 24 additions and 3 deletions
|
@ -485,13 +485,15 @@
|
|||
[/event]
|
||||
#enddef
|
||||
|
||||
#define PICKUPPABLE_ITEM ID X Y EXTRA_FILTER IMAGE MESSAGE OBJECT
|
||||
#define PICKUPPABLE_ITEM ID X Y EXTRA_FILTER IMAGE MESSAGE CANNOT_USE_MESSAGE OBJECT
|
||||
# This places an item on the map which can be picked up once, but allows the
|
||||
# player to choose whether the unit stepping on it should take it or not.
|
||||
# The "object" doesn't necessarily need to be an [object], any action works.
|
||||
#
|
||||
# Example:
|
||||
# ! {PICKUPPABLE_ITEM ring_of_hp 8 12 side=1 items/ring-red.png _"$unit.name finds a pretty ring. Should he pick it up?" (
|
||||
# ! {PICKUPPABLE_ITEM ring_of_hp 8 12 race=human items/ring-red.png
|
||||
# ! _"$unit.name finds a pretty ring. Should he pick it up?"
|
||||
# ! _"$unit.name finds a pretty ring. But only a human can take it!" (
|
||||
# ! [object]
|
||||
# ! name= _ "Ring of HP"
|
||||
# ! image=items/ring-red.png
|
||||
|
@ -515,10 +517,14 @@
|
|||
|
||||
[filter]
|
||||
x,y={X},{Y}
|
||||
{EXTRA_FILTER}
|
||||
[/filter]
|
||||
|
||||
[if]
|
||||
[have_unit]
|
||||
x,y={X},{Y}
|
||||
{EXTRA_FILTER}
|
||||
[/have_unit]
|
||||
|
||||
[variable]
|
||||
name=item_{ID}_picked_up
|
||||
not_equals=yes
|
||||
|
@ -558,6 +564,21 @@
|
|||
[/then]
|
||||
|
||||
[else]
|
||||
[if]
|
||||
[variable]
|
||||
name=item_{ID}_picked_up
|
||||
not_equals=yes
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[message]
|
||||
speaker=narrator
|
||||
message={CANNOT_USE_MESSAGE}
|
||||
image={IMAGE}
|
||||
[/message]
|
||||
[/then]
|
||||
[/if]
|
||||
|
||||
[allow_undo][/allow_undo]
|
||||
[/else]
|
||||
[/if]
|
||||
|
|
Loading…
Add table
Reference in a new issue