Welcome, Guest. Please login or register.
Kingdoms of Ahln
Pages: [1]
  Print  
Author Topic: Death message.  (Read 699 times)
Saffire
Citizen
***
Posts: 136


View Profile
« on: June 07, 2009, 08:45:30 pm »

Currently, when you kill something, it looks like this (More or less. My prompt is changed, but the idea stays the same):

Quote
You clench your hand into a fist and swing it at test person.
H:100/100 M:100/100 [- ]
The last bit of spark fades from test person's eye as it slumps to the ground.
H:100/100 M:100/100 [b ]
Your fist lands squarely in test person's face.
H:100/100 M:100/100 [b ]

To fix this and make the messages display in the correct order, change weapon_hit in events/weapon_combat.rb to this:

Code:
def weapon_hit(event, player, room)
    Combat.delete_event event
    player.balance = true
    event.target.balance = true
    player.info.in_combat = false
    event.target.info.in_combat = false
    room.out_event event
    Combat.inflict_damage player, event.target, 10 #temporary set amount of damage for now
end

As you can see, all you need to do is switch the order of the two bottom lines, so that room.out_event event is before combat.inflict_damage. Do the same for events/martial_combat.rb, and you're good to go.
Logged
Justin
Administrator
Citizen
*****
Posts: 189



View Profile
« Reply #1 on: June 07, 2009, 09:28:07 pm »

This is kind of odd, because you'd think I would have noticed that earlier...I did test this stuff. But I'm seeing the same thing.

Anyhow, switching the order can cause problems. For example, if the mob gets the event and checks its health, it might see the old value, rather than the new value.

I'm not sure what the solution would be, at the moment. Will think about it.
Logged
Justin
Administrator
Citizen
*****
Posts: 189



View Profile
« Reply #2 on: June 30, 2009, 02:42:49 am »

Alright, the changes here should fix the issue and address my concern about the object's view of its own health being inconsistent.

I also added an event so objects can react to any stat loss, just a single line from here.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2006-2009, Simple Machines
Terra97 design by Bloc