Fantasy Seal dmg buff and minor adjustments

This commit is contained in:
Andrei Alexeyev 2019-03-26 13:57:01 +02:00
parent bf2d1a81aa
commit 4e7c37976f
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
3 changed files with 20 additions and 7 deletions

View file

@ -303,7 +303,8 @@ static int reimu_spirit_bomb_orb(Projectile *p, int t) {
double circletime = 100+20*index;
if(t == circletime) {
p->args[3] = global.plr.pos - 128*I;
p->args[3] = global.plr.pos - 256*I;
p->flags &= ~PFLAG_NOCOLLISION;
play_sound("redirect");
}
@ -316,7 +317,7 @@ static int reimu_spirit_bomb_orb(Projectile *p, int t) {
complex target_homing = p->args[3];
complex homing = target_homing - p->pos;
complex v = 0.3 * (circlestrength * (target_circle - p->pos) + 0.2 * (1-circlestrength) * (homing + 2*homing/(cabs(homing)+0.01)));
p->args[2] += (v - p->args[2]) * 0.2;
p->args[2] += (v - p->args[2]) * 0.1;
p->pos += p->args[2];
for(int i = 0; i < 3 /*&& circlestrength < 1*/; i++) {
@ -350,12 +351,12 @@ static void reimu_spirit_bomb(Player *p) {
.draw_rule = reimu_spirit_bomb_orb_visual,
.rule = reimu_spirit_bomb_orb,
.args = { cexp(I*2*M_PI/count*i), i, 0, 0},
.timeout = 160 + 20 * i,
.timeout = 200 + 20 * i,
.type = PlrProj,
.damage = 0,
.damage = 1000,
.size = 10 + 10*I,
.layer = LAYER_PLAYER_FOCUS - 1,
.flags = PFLAG_NOREFLECT,
.flags = PFLAG_NOREFLECT | PFLAG_NOCOLLISION,
);
}
@ -640,9 +641,14 @@ static double reimu_spirit_property(Player *plr, PlrProperty prop) {
switch(prop) {
case PLR_PROP_SPEED: {
return base_value * (pow(player_get_bomb_progress(plr, NULL), 0.5));
float p = player_get_bomb_progress(plr, NULL);
if(p < 0.5) {
return base_value * p * 2;
}
}
// fallthrough
default: {
return base_value;
}

View file

@ -344,6 +344,10 @@ void calc_projectile_collision(Projectile *p, ProjCollisionResult *out_col) {
out_col->damage.amount = p->damage;
out_col->damage.type = p->damage_type;
if(p->flags & PFLAG_NOCOLLISION) {
goto skip_collision;
}
if(p->type == EnemyProj) {
Ellipse e_proj = {
.axes = p->collision_size,
@ -403,6 +407,8 @@ void calc_projectile_collision(Projectile *p, ProjCollisionResult *out_col) {
}
}
skip_collision:
if(out_col->type == PCOL_NONE && !projectile_in_viewport(p)) {
out_col->type = PCOL_VOID;
out_col->fatal = true;

View file

@ -41,7 +41,7 @@ typedef enum {
EnemyProj, // hazard, collides with player
DeadProj, // no collision, will be converted to a BPoint item shortly
Particle, // no collision, not a hazard
FakeProj, // hazard, but no collision
FakeProj attr_deprecated("Use PFLAG_NOCOLLISION instead"), // hazard, but no collision
PlrProj, // collides with enemies and bosses
} ProjType;
@ -57,6 +57,7 @@ typedef enum ProjFlags {
PFLAG_NOREFLECT = (1 << 9),
PFLAG_REQUIREDPARTICLE = (1 << 10),
PFLAG_PLRSPECIALPARTICLE = (1 << 11),
PFLAG_NOCOLLISION = (1 << 12),
PFLAG_NOSPAWNEFFECTS = PFLAG_NOSPAWNFADE | PFLAG_NOSPAWNFLARE,
} ProjFlags;