Re: Damage modification?

From: Limratana (wlimrata@merlin.cc.manhattan.edu)
Date: 07/17/96


On Wed, 17 Jul 1996, Ryan A.J. Biggs wrote:

> Ok, I am removing ROOM_DEATH types and replacing them with ROOM_DAMAGE 
> types (stop your gasping, I'm gonna explain myself) but I know that the 
> only way to call damage() is with both a victim and an attacker.  Now, 
> unless someone can give me a way around this, how can I modify it so that 
> if the victim=attacker, that it will not give a "<your name> hits you 
> hard" message, but a "You are hit hard" message.  This will also be 
> useful for other little things.
> 
> Now, the reason for ROOM_DAMAGE....if a DT is one that burns, what 
> happens if a player can resist fire?  If the DT is falling, what is the 
> player can fly?  I am going to make it so that you can resist, or even 
> avoid damage altogether if you have good protection.  This will make it a 
> littl more realistic, and add aan element of difficulty if you need to 
> attack a mob with a specific type of damage.
> 
> ------------------------------------------------------------------
> Ryan A.J. Biggs    email-ae744@freenet.toronto.on.ca
> Doppleganger, Charon the Boatman and member of Dieties Anonymous
> Owner of a 100% organic wibble and Plasma lamp, and rubber chicken
> Keeper of the sacred butcher knife and the Cloak of Shadows
> Compiler of the Net.Psionics.Handbook
> ------------------------------------------------------------------
> 
> 
> 
If you have figured out how to call damage() when the character enters 
the room, I think the rest will be easy.  Modify damage() to take on 
another parameter when called, an int probably.  Depending on the value 
of the int, your function will know if a room or another character caused 
the damage. (this involves modifiying the function a little to, to get 
rid of attacker character refrences).  When you have that extra 
parameter, it should act as a flag to determine the attack type, room or 
normal, and you should use the character for both the victim and attacker 
and just ignore the attacker code, using if (room_attacker) or something 
like that.  Hope this helps.  



This archive was generated by hypermail 2b30 : 12/07/00 PST