Appearance
add_exp
Prototypevoid add_exp(int amount, int active_sprite)
add_exp()
adds amount experience and creates a text-sprite to float above active_sprite
.
Dink
< 1.08
Requires that active_sprite
was last hit by Dink.
Dink
1.08
Freedink
all
Will work with any active_sprite
.
For most situations sp_exp() will work well enough and will automatically add and display the experience addition properly. However, if you change a monster's brain when it dies, Dink won't get the experience points. Here is an example of a work-around:
c
void die(void)
{
freeze(¤t_sprite);
// give Dink his experience:
int &dinks_exp = sp_exp(¤t_sprite, -1);
add_exp(&dinks_exp, ¤t_sprite);
// if sprite was placed by the editor, make it not come
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
{
editor_type(&hold, 1);
}
//shrink to this percent then die:
sp_brain_parm(¤t_sprite, 10);
sp_brain(¤t_sprite, 12);
}
It could also be useful in giving Dink experience for quests, so the player can see how much experience they got.
c
void talk(void)
{
freeze(1);
freeze(¤t_sprite);
say_stop("`6Yeah, this is one tough quest, talk to me. Jeez.", ¤t_sprite);
wait(500);
say_stop("Where's my exp?", 1);
wait(250);
add_exp(300, ¤t_sprite);
wait(250);
say_stop("`6There you go.", ¤t_sprite);
unfreeze(¤t_sprite);
unfreeze(1);
}