stage6: formatting

This commit is contained in:
Andrei Alexeyev 2023-02-05 03:49:00 +01:00
parent f0b564a290
commit 115c90273f
No known key found for this signature in database
GPG key ID: 72D26128040B9690
5 changed files with 17 additions and 22 deletions

View file

@ -57,7 +57,7 @@ DEFINE_ENTITY_TYPE(EllyBaryons, {
cmplx target_poss[NUM_BARYONS];
real relaxation_rate;
// angles are currently unused, broglie sign may use them. otherwise remove.
// angles are currently unused, broglie sign may use them. otherwise remove.
real angles[NUM_BARYONS];
cmplx center_pos;
@ -65,7 +65,7 @@ DEFINE_ENTITY_TYPE(EllyBaryons, {
float scale;
COEVENTS_ARRAY(
despawned
despawned
) events;
});

View file

@ -31,7 +31,7 @@ static void baryons_final_blast(cmplx pos) {
{
RNG_ARRAY(R, 8);
PARTICLE(
.sprite = "blast_huge_halo",
.pos = pos + exp(4*vrng_real(R[0])) * vrng_dir(R[1]),
@ -74,7 +74,7 @@ static void baryons_final_blast(cmplx pos) {
}
TASK(baryon_explode_movement, { BoxedEllyBaryons baryons; BoxedBoss boss; }) {
EllyBaryons *baryons = TASK_BIND(ARGS.baryons);
EllyBaryons *baryons = TASK_BIND(ARGS.baryons);
for(int t = 0;; t++) {
cmplx boss_pos = NOT_NULL(ENT_UNBOX(ARGS.boss))->pos;
@ -91,7 +91,7 @@ TASK(baryon_explode_movement, { BoxedEllyBaryons baryons; BoxedBoss boss; }) {
}
TASK(baryons_explode, { BoxedEllyBaryons baryons; BoxedBoss boss; }) {
EllyBaryons *baryons = TASK_BIND(ARGS.baryons);
EllyBaryons *baryons = TASK_BIND(ARGS.baryons);
int lifetime = 120;
int interval = 6;
@ -105,7 +105,7 @@ TASK(baryons_explode, { BoxedEllyBaryons baryons; BoxedBoss boss; }) {
if(dead[i]) {
continue;
}
float angle = rng_angle();
PARTICLE(
.sprite = "blast_huge_halo",
@ -119,7 +119,7 @@ TASK(baryons_explode, { BoxedEllyBaryons baryons; BoxedBoss boss; }) {
);
if(rng_chance((t - lifetime) / 300.0)) {
dead[i] = true;
dead[i] = true;
baryons_final_blast(baryons->poss[i]);
}
}
@ -152,7 +152,7 @@ DEFINE_EXTERN_TASK(stage6_boss_baryons_explode) {
EllyBaryons *baryons = NOT_NULL(ENT_UNBOX(ARGS.baryons));
baryons->scale = 0;
stage_shake_view(40);
play_sfx("boom");

View file

@ -38,7 +38,7 @@ TASK(kepler_bullet_spawner, { BoxedProjectile proj; int tier; cmplx offset; }) {
WAIT(interval);
}
}
DEFINE_TASK(kepler_bullet) {
cmplx pos = ARGS.pos;
Projectile *parent = ENT_UNBOX(ARGS.parent);
@ -49,7 +49,7 @@ DEFINE_TASK(kepler_bullet) {
.proto = kepler_pick_bullet(ARGS.tier),
.pos = pos + ARGS.offset,
.color = RGB(0.3 + 0.3 * ARGS.tier, 0.6 - 0.3 * ARGS.tier, 1.0),
));
p->move.retention = 0;
@ -92,7 +92,7 @@ DEFINE_EXTERN_TASK(stage6_spell_kepler) {
INVOKE_SUBTASK(kepler_scythe, ARGS.scythe, boss->pos);
elly_clap(boss, 20);
for(int t = 0;; t++) {
int c = 2;
play_sfx("shot_special1");
@ -108,7 +108,6 @@ DEFINE_EXTERN_TASK(stage6_spell_kepler) {
INVOKE_TASK_DELAYED(20, kepler_bullet, .parent = ENT_BOX(p), .tier = 1, .offset = 10 * dir);
}
WAIT(20);
}

View file

@ -66,5 +66,5 @@ DEFINE_EXTERN_TASK(stage6_spell_maxwell) {
elly_clap(boss, 50);
play_sfx("laser1");
STALL;
STALL;
}

View file

@ -29,7 +29,7 @@ TASK(spawn_square, { BoxedProjectileArray *projectiles; cmplx pos; cmplx dir; re
play_sfx("shot2");
WAIT(delay);
}
}
static void spawn_apples(cmplx pos) {
@ -45,7 +45,7 @@ static void spawn_apples(cmplx pos) {
.color = RGB(1.0, 0.5, 0),
.layer = LAYER_BULLET | 0xffff, // force them to render on top of the other bullets
);
}
}
}
TASK(newton_scythe_movement, { BoxedEllyScythe scythe; BoxedBoss boss; }) {
@ -53,23 +53,19 @@ TASK(newton_scythe_movement, { BoxedEllyScythe scythe; BoxedBoss boss; }) {
scythe->spin = 0.5;
real radius = 300;
real speed = 0.01;
int steps = M_TAU/speed;
for(int n = 2;; n++) {
for(int i = 0; i < steps; i++) {
real t = M_TAU/steps*i;
Boss *boss = NOT_NULL(ENT_UNBOX(ARGS.boss));
if(i % (steps/(2*n)) == 0) {
spawn_apples(boss->pos);
}
scythe->pos = boss->pos + radius * sin(n*t) * cdir(t) * I;
YIELD;
}
@ -82,7 +78,7 @@ TASK(newton_scythed_proj, { BoxedProjectile proj; }) {
play_sfx("redirect");
real acceleration = difficulty_value(0.015, 0.02, 0.03, 0.04);
p->move.velocity = 0;
p->move.acceleration = acceleration * aim;
}