Better dagger throw hits and new skill graphics.
This commit is contained in:
parent
c360aa75ee
commit
ca83fa38fe
Binary file not shown.
After Width: | Height: | Size: 848 B |
|
@ -86,8 +86,12 @@ projectile_update(Projectile *p, Player *player, RoomMatrix *rm, float deltatime
|
||||||
|
|
||||||
if (space->monster) {
|
if (space->monster) {
|
||||||
Uint32 dmg = stats_fight(&player->stats, &space->monster->stats);
|
Uint32 dmg = stats_fight(&player->stats, &space->monster->stats);
|
||||||
|
if (dmg > 0) {
|
||||||
|
gui_log("Your dagger pierced %s for %u damage", space->monster->lclabel, dmg);
|
||||||
|
mixer_play_effect(SWORD_HIT);
|
||||||
|
player->hits += 1;
|
||||||
|
}
|
||||||
monster_hit(space->monster, dmg);
|
monster_hit(space->monster, dmg);
|
||||||
mixer_play_effect(SWORD_HIT);
|
|
||||||
}
|
}
|
||||||
p->alive = false;
|
p->alive = false;
|
||||||
}
|
}
|
||||||
|
|
18
src/skill.c
18
src/skill.c
|
@ -111,11 +111,11 @@ skill_use_flurry(Skill *skill, SkillData *data)
|
||||||
static Skill *
|
static Skill *
|
||||||
create_flurry(void)
|
create_flurry(void)
|
||||||
{
|
{
|
||||||
Texture *t = texturecache_add("Items/MedWep.png");
|
Texture *t = texturecache_add("Extras/Skills.png");
|
||||||
Sprite *s = sprite_create();
|
Sprite *s = sprite_create();
|
||||||
sprite_set_texture(s, t, 0);
|
sprite_set_texture(s, t, 0);
|
||||||
s->dim = DEFAULT_DIMENSION;
|
s->dim = GAME_DIMENSION;
|
||||||
s->clip = CLIP16(0, 0);
|
s->clip = CLIP32(0, 0);
|
||||||
s->fixed = true;
|
s->fixed = true;
|
||||||
Skill *skill = create_default("Flurry", s);
|
Skill *skill = create_default("Flurry", s);
|
||||||
skill->use = skill_use_flurry;
|
skill->use = skill_use_flurry;
|
||||||
|
@ -147,11 +147,11 @@ skill_throw_dagger(Skill *skill, SkillData *data)
|
||||||
static Skill *
|
static Skill *
|
||||||
create_throw_dagger(void)
|
create_throw_dagger(void)
|
||||||
{
|
{
|
||||||
Texture *t = texturecache_add("Extras/Dagger.png");
|
Texture *t = texturecache_add("Extras/Skills.png");
|
||||||
Sprite *s = sprite_create();
|
Sprite *s = sprite_create();
|
||||||
sprite_set_texture(s, t, 0);
|
sprite_set_texture(s, t, 0);
|
||||||
s->dim = DEFAULT_DIMENSION;
|
s->dim = GAME_DIMENSION;
|
||||||
s->clip = CLIP16(0, 0);
|
s->clip = CLIP32(64, 0);
|
||||||
s->fixed = true;
|
s->fixed = true;
|
||||||
Skill *skill = create_default("Throw dagger", s);
|
Skill *skill = create_default("Throw dagger", s);
|
||||||
skill->instantUse = false;
|
skill->instantUse = false;
|
||||||
|
@ -257,11 +257,11 @@ skill_charge(Skill *skill, SkillData *data)
|
||||||
static Skill *
|
static Skill *
|
||||||
create_charge(void)
|
create_charge(void)
|
||||||
{
|
{
|
||||||
Texture *t = texturecache_add("Commissions/Warrior.png");
|
Texture *t = texturecache_add("Extras/Skills.png");
|
||||||
Sprite *s = sprite_create();
|
Sprite *s = sprite_create();
|
||||||
sprite_set_texture(s, t, 0);
|
sprite_set_texture(s, t, 0);
|
||||||
s->dim = DEFAULT_DIMENSION;
|
s->dim = GAME_DIMENSION;
|
||||||
s->clip = CLIP16(48, 32);
|
s->clip = CLIP32(32, 0);
|
||||||
s->fixed = true;
|
s->fixed = true;
|
||||||
Skill *skill = create_default("Charge", s);
|
Skill *skill = create_default("Charge", s);
|
||||||
skill->use = skill_charge;
|
skill->use = skill_charge;
|
||||||
|
|
|
@ -149,7 +149,10 @@ render_skills(Player *player, Camera *cam)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Skill *skill = player->skills[i];
|
Skill *skill = player->skills[i];
|
||||||
skill->icon->pos = (Position) { 8 + i * 32, 8 };
|
if (skill->icon->dim.width >16)
|
||||||
|
skill->icon->pos = (Position) { i * 32, 0 };
|
||||||
|
else
|
||||||
|
skill->icon->pos = (Position) { 8 + i * 32, 8 };
|
||||||
sprite_render(skill->icon, cam);
|
sprite_render(skill->icon, cam);
|
||||||
|
|
||||||
if (player->skills[i]->active) {
|
if (player->skills[i]->active) {
|
||||||
|
|
Loading…
Reference in New Issue