Added the SKILL_RADIUS artifact (not used yet)

Also drops the levelcap on artifact drops. I don't think it really
matters if you get an artifact before you have the skill. This should
make the shop a bit more useful.
This commit is contained in:
Linus Probert 2019-05-10 12:47:33 +02:00
parent 81e7df1920
commit 67e29d609d
2 changed files with 51 additions and 7 deletions

View File

@ -65,6 +65,9 @@ artifact_set_effect(Artifact *a, MagicalEffect effect)
a->info.name = "Shadow cloak"; a->info.name = "Shadow cloak";
a->info.desc = "You feel more in phase with the world"; a->info.desc = "You feel more in phase with the world";
break; break;
case SKILL_RADIUS:
a->info.name = "Magic wand";
a->info.desc = "Your magic has greater reach";
default: default:
break; break;
} }
@ -92,6 +95,41 @@ static int RogueArtifacts[] = {
PHASE_IMPROVEMENT // 7 PHASE_IMPROVEMENT // 7
}; };
static int MageArtifacts[] = {
IMPROVED_HEARING, // 0
TRAP_AVOIDANCE, // 1
PIERCING_DAGGERS, // 2
DAGGER_RECOVERY, // 3
PUSH_BACK, // 4
FEAR_INDUCING, // 5
INCREASED_STUN, // 6
SKILL_RADIUS // 7
};
/* Not in play yet */
static int PaladinArtifacts[] = {
IMPROVED_HEARING, // 0
TRAP_AVOIDANCE, // 1
PIERCING_DAGGERS, // 2
DAGGER_RECOVERY, // 3
PUSH_BACK, // 4
FEAR_INDUCING, // 5
INCREASED_STUN, // 6
SKILL_RADIUS // 7
};
/* Not in play yet */
static int EngineerArtifacts[] = {
IMPROVED_HEARING, // 0
TRAP_AVOIDANCE, // 1
PIERCING_DAGGERS, // 2
DAGGER_RECOVERY, // 3
PUSH_BACK, // 4
FEAR_INDUCING, // 5
INCREASED_STUN, // 6
PHASE_IMPROVEMENT // 7
};
static void static void
add_level_sprite(Artifact *a) add_level_sprite(Artifact *a)
{ {
@ -109,17 +147,17 @@ add_level_sprite(Artifact *a)
Artifact * Artifact *
artifact_create_random(Player *p, Uint8 level) artifact_create_random(Player *p, Uint8 level)
{ {
int option = -1; int option = get_random(7);
if (p->stats.lvl >= 4)
option = get_random(7);
else if (p->stats.lvl >= 3)
option = get_random(6);
else
option = get_random(5);
int * artifactPool = NULL; int * artifactPool = NULL;
if (p->class == ROGUE) if (p->class == ROGUE)
artifactPool = RogueArtifacts; artifactPool = RogueArtifacts;
else if (p->class == MAGE)
artifactPool = MageArtifacts;
else if (p->class == PALADIN)
artifactPool = PaladinArtifacts;
else if (p->class == ENGINEER)
artifactPool = EngineerArtifacts;
else else
artifactPool = WarriorArtifacts; artifactPool = WarriorArtifacts;
@ -196,6 +234,11 @@ artifact_sprite_for(MagicalEffect effect)
sprite_set_texture(sprite, t, 0); sprite_set_texture(sprite, t, 0);
sprite->clip = CLIP16(1*16, 5*16); sprite->clip = CLIP16(1*16, 5*16);
break; break;
case SKILL_RADIUS:
t = texturecache_add("Items/Wand.png");
sprite_set_texture(sprite, t, 0);
sprite->clip = CLIP16(2*16, 0);
break;
default: default:
break; break;
} }

View File

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