Introduced the phase artifact

This commit is contained in:
Linus Probert 2018-10-02 13:08:32 +02:00
parent 0dcb658076
commit 97ad1ddd23
2 changed files with 42 additions and 4 deletions

View File

@ -60,23 +60,55 @@ artifact_set_effect(Artifact *a, MagicalEffect effect)
a->info.name = "Ugly shirt"; a->info.name = "Ugly shirt";
a->info.desc = "You look disgusting"; a->info.desc = "You look disgusting";
break; break;
case PHASE_IMPROVEMENT:
a->info.name = "Shadow cloak";
a->info.desc = "You feel more in phase with the world";
break;
default: default:
break; break;
} }
} }
static int WarriorArtifacts[] = {
IMPROVED_HEARING, // 0
TRAP_AVOIDANCE, // 1
PIERCING_DAGGERS, // 2
DAGGER_RECOVERY, // 3
PUSH_BACK, // 4
FEAR_INDUCING, // 5
INCREASED_STUN, // 6
CHARGE_THROUGH // 7
};
static int RogueArtifacts[] = {
IMPROVED_HEARING, // 0
TRAP_AVOIDANCE, // 1
PIERCING_DAGGERS, // 2
DAGGER_RECOVERY, // 3
PUSH_BACK, // 4
FEAR_INDUCING, // 5
INCREASED_STUN, // 6
PHASE_IMPROVEMENT // 7
};
Artifact * Artifact *
artifact_create_random(Player *p, Uint8 level) artifact_create_random(Player *p, Uint8 level)
{ {
int option = -1; int option = -1;
if (p->stats.lvl >= 4) if (p->stats.lvl >= 4)
option = get_random(LAST_ARTIFACT_EFFECT - 1); option = get_random(7);
else if (p->stats.lvl >= 3) else if (p->stats.lvl >= 3)
option = get_random(INCREASED_STUN); option = get_random(6);
else else
option = get_random(FEAR_INDUCING); option = get_random(5);
Artifact *a = artifact_create(option); int * artifactPool = NULL;
if (p->class == ROGUE)
artifactPool = RogueArtifacts;
else
artifactPool = WarriorArtifacts;
Artifact *a = artifact_create(artifactPool[option]);
a->level = level; a->level = level;
return a; return a;
} }
@ -127,6 +159,11 @@ artifact_sprite_for(MagicalEffect effect)
sprite_set_texture(sprite, t, 0); sprite_set_texture(sprite, t, 0);
sprite->clip = CLIP16(6*16, 8*16); sprite->clip = CLIP16(6*16, 8*16);
break; break;
case PHASE_IMPROVEMENT:
t = texturecache_add("Items/Armor.png");
sprite_set_texture(sprite, t, 0);
sprite->clip = CLIP16(1*16, 5*16);
break;
default: default:
break; break;
} }

View File

@ -29,6 +29,7 @@ typedef enum MagicalEffect {
FEAR_INDUCING, FEAR_INDUCING,
INCREASED_STUN, INCREASED_STUN,
CHARGE_THROUGH, CHARGE_THROUGH,
PHASE_IMPROVEMENT,
LAST_ARTIFACT_EFFECT // Sentinel LAST_ARTIFACT_EFFECT // Sentinel
} MagicalEffect; } MagicalEffect;