changing the damage for the fireball
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 = ¤t_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);
}
}
}
//script for individual fireball
void main( void )
{
int &mcrap;
int &scrap;
int &junk;
}
void damage( void )
{
playsound(18, 8000,0,0,0);
&scrap = ¤t_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);
}
}
}
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.
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.
another thing...
how would i change the cooldown time of the spell?
like how long you have to wait for it to charge
how would i change the cooldown time of the spell?
like how long you have to wait for it to charge
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.
&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.
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.
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
spawn("dam-bom");
kill_this_item();
For bombs, you'll have to look in dam-bom.c










