Follow-up Comment #9, patch #2851 (project wesnoth):

Yes, that strikes me as a rather bad idea.  What if I need to make a unit
that regains 1 HP every time a living unit dies anywhere?  Or that gives all
friendly units +5% to all defenses until the end of the turn when it dies? 
Events in unit types should have access to everything that an event anywhere
else has access to.

Events in unit types aren't like variables in functions - a closer analogy
would be class methods that have been set as listeners on some global event. 
As such, it would make sense to give them a context (i.e. let them know what
unit type they came from) but not to limit what events they're able to respond
to.

Currently the only analog that WML has for one function calling another is
[fire_event], which isn't ideal, but Lua provides for function calls, and
allowing [fire_event] to call a unique event by ID would be a simple change
(on top of the event_ids patch).

Scoped variables within events would also be helpful.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?2851>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to