Implementd the skill. Still not tested.

This commit is contained in:
Linus Probert 2018-10-02 10:29:32 +02:00
parent b4fd2cb8b4
commit ee5ed1421f
1 changed files with 30 additions and 2 deletions

View File

@ -523,6 +523,33 @@ create_backstab(void)
return skill; return skill;
} }
static bool
skill_phase(Skill *skill, SkillData *data)
{
UNUSED(skill);
data->player->phase_count = 3;
return true;
}
static Skill *
create_phase(void)
{
Texture *t = texturecache_add("Extras/Skills.png");
Sprite *s = sprite_create();
sprite_set_texture(s, t, 0);
s->dim = GAME_DIMENSION;
s->clip = CLIP32(32, 0);
s->fixed = true;
Skill *skill = create_default("Phase", s);
skill->levelcap = 4;
skill->instantUse = true;
skill->resetTime = 8;
skill->available = NULL;
skill->use = skill_phase;
skill->actionRequired = false;
return skill;
}
static bool static bool
skill_sip_health_available(Player *player) skill_sip_health_available(Player *player)
{ {
@ -738,8 +765,9 @@ skill_create(enum SkillType t, Camera *cam)
skill->tooltip = tooltip_create(backstab_tooltip, cam); skill->tooltip = tooltip_create(backstab_tooltip, cam);
break; break;
case PHASE: case PHASE:
error("Skill %d not implemented", t); skill = create_phase();
return NULL; skill->tooltip = tooltip_create(phase_tooltip, cam);
break;
default: default:
fatal("Unknown SkillType %u", (unsigned int) t); fatal("Unknown SkillType %u", (unsigned int) t);
return NULL; return NULL;