Spells with fixed damage

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Spells with fixed damage

Post by Chaos Awakes »

How can I create a spell which does two things:

1) Do a FIXED amount of damage to the party, in percent. IE: damage health by 50%
2) Create an item.

I want a spell called "purse of pain" which creates a coin in hand but also damages the party for 50% health so they will only use it as a last resort because they'd have to either sleep forever to get health back at the cost of food/water, or cast lots of spells at the cost of mana.

I can do this by cloning the fireball spell and making it create the coin in hand when it explodes, and then creating a spell which creates the fireball on the ground so it explodes on the party instantly. But the fireball is created according to the level of the spell cast, which is no good. The player is not likely to cast a MON level spell to get a coin knowing that this will generate the most damage. He will always cast a LO spell and get the least damage, but will always receive a coin.

Two problems that I can see:

1) How can a spell do two actions.
2) How can I have a fixed damage no matter what level spell is cast?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

1) A spell can do two actions if its action calls a relay that targets to action wallitems
2) Damage tile cration and destruction on the party tile. If it isn't already coded to allow a percentage damage to be used, then I guess this could be a suggestion (I forget but remember lots of things now have percentages useable such as healing and experience, I think)
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

1) Yep - use a relay; have a look at the complex actions example dungeon which uses some of these.

2) To have a fixed (absolute) damage level, have the triggered WALLITEM_ACTION have a *non-zero* strength. A zero strength means that the action inherrits the strength from the thing that called it (e.g. the spell caster spell power), a non-zero strength uses the given strength.

BTW - I wouldn't recommend having a percentage damage; for your coin, the party would be able to use it infinitely (the first flip reduces health to 50%, the next to 25%, the next to 12.5%, the next to 6.25% etc etc and they would never die!).
User avatar
Daecon
Expert
Posts: 329
Joined: Tue May 16, 2006 1:56 pm
Location: Upper Hutt, New Zealand

Post by Daecon »

Is it not possible to have it as a 50% of the maximum value, instead of 50% of the "current" value?
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Post by Chaos Awakes »

Thanks GG,

One thing I'm not clear on. When you use an action such as do something to tile in front, isn't that the tile in front of where the action is? So if my spell targets an action on a wallitem and the wallitem says "create damage tile on square", won't the damage tile appear on the square where the wallitem action is and not where the party is?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

The action will seen to be generated by the person or tile starting the chain - ie the party in the case of the spell, whcih it sounds liek you are doing.

If you have the action generated by a spell exploding, then the action will be generated on the tile explosion

So if you want the party to be damaged and a spell effect to fly, then have the damage and spell effect be generated by the party, then secondary actions generated by the spell, etc.
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Post by Chaos Awakes »

It's working ok, but I'm getting an odd amount of damage. I have the strength of the action set to 50, and was therefore expecting to get 50 damage every time. In fact, I get 18 or 19 damage every time no matter what level of spell I cast.
So how does 50 relate to 19? I'm using a test character with maxed stats (255, 255, etc). Is the number 50 in some way in relation to the strength of the character. Why does 50 not mean 50? (scratches head)
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Post by Chaos Awakes »

What I really wanted with the percentage thing was to make sure that the player could only generate perhaps 2 coins before dying or having to rest. But with an absolute value they will be able to generate more coins as they get stronger, which defeats the logic of my duneon mechanics. If a level only should allow a couple of coins, it's no good really if a really strong character can get 20 and a weak one can get 2.
User avatar
Daecon
Expert
Posts: 329
Joined: Tue May 16, 2006 1:56 pm
Location: Upper Hutt, New Zealand

Post by Daecon »

What about instead of the action strength being set to 50, you assign it with a "bonus" of -50 to health or something?

Will that work for what you're trying to achieve?
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Chaos Awakes wrote:One thing I'm not clear on. When you use an action such as do something to tile in front, isn't that the tile in front of where the action is? So if my spell targets an action on a wallitem and the wallitem says "create damage tile on square", won't the damage tile appear on the square where the wallitem action is and not where the party is?
Like the strength, the location is also inherrited from the chain of triggers. So in your example, a spell can target some remotely located relay that then triggers an action - that action will use the location of the spell caster rather than itself.

Note that you can also alter the location to somewhere else if that's what you want instead. For example, have a look at how the tables move in DM2 - that uses a click that's originated on the partys square, which passes through a relay that moves the location forward by one (i.e. to the tile that contains the table) and then performs the move action so that the table moves...
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Chaos Awakes wrote:It's working ok, but I'm getting an odd amount of damage. I have the strength of the action set to 50, and was therefore expecting to get 50 damage every time. In fact, I get 18 or 19 damage every time no matter what level of spell I cast.
So how does 50 relate to 19? I'm using a test character with maxed stats (255, 255, etc). Is the number 50 in some way in relation to the strength of the character. Why does 50 not mean 50? (scratches head)
The 50 denotes 50% of the maximum damage (which, for a fireball is 255 points of damage) - i.e. your fireball explosion will do an intrinsic damage level of 128 points.

That is then reduced by your characters anti-fire level which is 255. The calculation for this is given by damage = damage - (255/300*damage)...

...which is 18 or 19 as you (or at least I :wink: ) would expect.

If you want to do a fixed amount of damage, use a "damage" tile, or even a lightning bolt (which wouldn't get the anti-fire reduction).
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

George Gilbert wrote:a lightning bolt (which wouldn't get the anti-fire reduction).
It would get an anti-magic reduction though. :D
User avatar
mikko
Craftsman
Posts: 102
Joined: Sun Jan 15, 2006 2:42 pm
Location: Helsinki, Finland

Post by mikko »

And with the fireball you could just cast strong fireshields and then create all the coins you like.. And for lightning.. spell shields? ..

This kind of thing would need absolute damage that could not be resisted in any way. Just straight reduction from the health. And preferably 50% or maybe even 60-90% of each individual characters current maximum health. So if they haven't taken prior damage they would surely survive the first cast, but if you cast it again before healing they'd all die.
Post Reply