StendhalRefactoring: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin No edit summary |
imported>MiguelAngelBlanchLardin No edit summary |
||
| Line 51: | Line 51: | ||
== Events == |
== Events == |
||
Creatures can recieve the next list of events: |
Creatures can recieve the next list of events: |
||
* onAttack(target, weapon) |
* onAttack(target, weapon)<br>''called when attacking a target with the given weapon.'' |
||
* onAttacked(attacker, weapon) |
* onAttacked(attacker, weapon)<br>''called when attacked by someone with a given weapon.'' |
||
* onStopAttack(target) |
* onStopAttack(target)<br>''called when we stop attacking target'' |
||
* onStopAttacked(target) |
* onStopAttacked(target)<br>''called when target stops attacking us'' |
||
* onDamage(type, amount) |
* onDamage(type, amount)<br>''called when entity is damaged with the damage type (physical, fire, poison, magical, ... ) and the amount of damage done.'' |
||
* onKilled(attacker, weapon) |
* onKilled(attacker, weapon)<br>''called when attacked killed us with the given weapon'' |
||
* onKill(target) |
* onKill(target)<br>''called when entity kills target'' |
||
* onMove(x,y) |
* onMove(x,y)<br>''called when entity moves to x,y ( before moving in fact )'' |
||
* onCollide(x,y) |
* onCollide(x,y)<br>''called when entity collide at position x,y'' |
||
* onCollideWith(target) |
* onCollideWith(target)<br>''called when entity collide with another entity'' |
||
* onEquip(item, slot) |
* onEquip(item, slot)<br>''called when entity equips item on the given slot'' |
||
* onEquipped(source, slot) |
* onEquipped(source, slot)<br>''called when entity is equipped on the source entity and in the given slot'' |
||
* onDrop(item, slot) |
* onDrop(item, slot)<br>''called when entity drops item from the given slot to floor'' |
||
* onDropped(source, x, y) |
* onDropped(source, x, y)<br>''called when entity is dropped by source to floor at position x,y'' |
||
* onChat(source, text) |
* onChat(source, text)<br>''called when someone speaks near entity or write to entity'' |
||
* onUse(item) |
* onUse(item)<br>''called when entity use item'' |
||
* onUseWith(base, item) |
* onUseWith(base, item)<br>''called when entity use item on base item'' |
||
* onUsed(source) |
* onUsed(source)<br>''called when entity is used by source'' |
||
* onUsedWith(source, base) |
* onUsedWith(source, base)<br>''called when entity is used by source on base item'' |
||
* onStop() |
* onStop()<br>''called when entity stops moving, attacking, etc...'' |
||
Revision as of 12:21, 24 October 2005
Items
We have the next items structure:
- Shields
- Wooden shield
- Studded shield
- Plate shield
- Copper shield
- Swords
- knife
- Sword
- Long sword
- Broadsword
- Armors
- Leather armor
- Studded armor
- Plater armor
- Copper armor
- Boots
- Sandals
- Leather
- Helmet
- Leather helmet
- Studded helmet
- Chain helmet
- Viking helmet
- Legs
- Leather legs
- Studded legs
- Chain legs
- Corpse
- Money
- Book
- Food
- Meat
- Cheese
- Bread
Creatures
Actions
- Move
- Stop
- Chat
- Tell
- Outfit
- Attack
- Use
- Equip
- Drop
- Own ( a sheep )
Events
Creatures can recieve the next list of events:
- onAttack(target, weapon)
called when attacking a target with the given weapon. - onAttacked(attacker, weapon)
called when attacked by someone with a given weapon. - onStopAttack(target)
called when we stop attacking target - onStopAttacked(target)
called when target stops attacking us - onDamage(type, amount)
called when entity is damaged with the damage type (physical, fire, poison, magical, ... ) and the amount of damage done. - onKilled(attacker, weapon)
called when attacked killed us with the given weapon - onKill(target)
called when entity kills target - onMove(x,y)
called when entity moves to x,y ( before moving in fact ) - onCollide(x,y)
called when entity collide at position x,y - onCollideWith(target)
called when entity collide with another entity - onEquip(item, slot)
called when entity equips item on the given slot - onEquipped(source, slot)
called when entity is equipped on the source entity and in the given slot - onDrop(item, slot)
called when entity drops item from the given slot to floor - onDropped(source, x, y)
called when entity is dropped by source to floor at position x,y - onChat(source, text)
called when someone speaks near entity or write to entity - onUse(item)
called when entity use item - onUseWith(base, item)
called when entity use item on base item - onUsed(source)
called when entity is used by source - onUsedWith(source, base)
called when entity is used by source on base item - onStop()
called when entity stops moving, attacking, etc...