The Dink Network

changing the damage for the fireball

August 25th 2006, 12:27 AM
duck.gif
maacks
Peasant He/Him
 
What part of the damage script for the fireball(below) would I change to set the damage it does?
//script for individual fireball
void main( void )
{
int &mcrap;
int &scrap;
int &junk;
}

void damage( void )
{
playsound(18, 8000,0,0,0);

&scrap = &current_sprite;
kill_shadow(&scrap);
sp_seq(&scrap, 70);
sp_pseq(&scrap, 70);
sp_frame(&scrap, 1);
sp_brain(&scrap, 7);
&mcrap = sp_y(&scrap, -1);
&mcrap -= 35;
sp_y(&scrap, &mcrap);

&mcrap = sp_pseq(&missile_target, -1);
&scrap = sp_pframe(&missile_target, -1);
int &hold = sp_editor_num(&missile_target);

if (&mcrap == 32)
{
if (&scrap == 1)
{
//they hit a tree, lets burn the thing
sp_hard(&missile_target, 1);
draw_hard_sprite(&missile_target);

&junk = is_script_attached(&missile_target);
if (&junk > 0)
{
//Script is attached to this tree! Let's run it's die script
run_script_by_number(&junk, "DIE");
return;
}

if (&hold != 0)
{
//this was placed by the editor, lets make the tree stay burned
editor_type(&hold, 4);
editor_seq(&hold, 20);
editor_frame(&hold, 29);
//type means show this seq/frame combo as background in the future
}

sp_pseq(&missile_target, 20);
sp_pframe(&missile_target, 29);
sp_hard(&missile_target, 0);
draw_hard_sprite(&missile_target);
sp_seq(&missile_target, 20);
playsound(6, 8000,0,&missile_target,0);

}
}

}
August 25th 2006, 12:58 AM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
Believe it or not, but the damage inflicted by the fireball is not in that script. The damage is set in item-fb.c with the line sp_strength(&junk, 10);

dam-fire.c is merely the script that is called after the fireball hits something. It gives the game instructions to create a little explosion sprite, get rid of its shadow, and for it burn a tree, if the object it hit is, in fact, a burnable tree.
August 25th 2006, 01:21 AM
duck.gif
maacks
Peasant He/Him
 
ok. Thank you.
August 25th 2006, 01:41 AM
duck.gif
maacks
Peasant He/Him
 
another thing...
how would i change the cooldown time of the spell?
like how long you have to wait for it to charge
August 25th 2006, 02:03 AM
death.gif
Dunno about that, Macaca.
August 25th 2006, 02:25 AM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
That's also in item-fb.c. The cost of the spell is determined by the required global variable &magic_cost. The cooldown time is determined by some kind of formula (I'd guess something close to &magic_cost/&magic*10 = # of seconds).

&magic is Dink's own magic stat.

EDIT: Oh, and according to the DinkC reference, &magic_cost values less than 100 have been known to crash the game.
August 25th 2006, 02:29 AM
death.gif
Basically, your looking at the wrong script. All that this script does is tell the missile to stop and explode when it hits something. It is good to refer to if you want something to respond to the fact that it has been hit by a missile, if not... well, best to leave it alone. The actual spell stats are defined by the item script, this same rule applies to weapons, eg. bombs and arrows.
August 25th 2006, 06:26 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Nope, not bombs. The only code in void use( void ) of item-bom is

spawn("dam-bom");
kill_this_item();

For bombs, you'll have to look in dam-bom.c
August 25th 2006, 01:40 PM
death.gif
Those dam boms!