taisei/src/common_tasks.h
Andrei Alexeyev 48f0a21e81
Stage 2 revamp (#229)
* stage2: remake wriggle non

* stage2: coroutinize first enemy

* stage2: coroutinize small_spin_circle (renamed redwall_fairy)

* stage2: remake aimshot fairies

* stage2: remove dead code

* stage2: blind-coroutinize flea-shooting fairy; not tested at all

* stage2: some hina nonspell shenanigans

* stage2: coroutinize amulet of harm (very lazily)

* stage2: lame hina nons (no balance)

* stage2: remake wheel of fortune (lunatic tuning only for now)

* stage2: Add raz's Hina nonspell

* coroutinize bad pick

* bad pick tweaks

* coroutinize and remake Monty Hall Danmaku

* stage2: coroutinize turning fairies

* it's big brain time

* look ma, i'm doing level design!

* stage2 second half (WIP)

* stage2: use new enemy spawners

* stage2: remove dead code

* stage2: fix post-midboss turning fairies

* stage2: swap post-midboss red/blue aimshot fairies order

* stage2: amulet of harm redesign prototype

* Amulet of Harm tweaks:

	* Less erratic boss movement
	* Improved "amulet" visuals

* stage2: very bare-bones difficulty scaling (enemies only)

* stage2: wheel of fortune balance tweaks

* stage2: amulet of harm difficulty balancing

* stage2: add hina spin animation to amulet of harm

* stage2: remove dead code
2020-12-01 19:25:00 +02:00

115 lines
2.2 KiB
C

/*
* This software is licensed under the terms of the MIT License.
* See COPYING for further information.
* ---
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@taisei-project.org>.
*/
#ifndef IGUARD_common_tasks_h
#define IGUARD_common_tasks_h
#include "taisei.h"
#include "coroutine.h"
#include "item.h"
#include "move.h"
#include "entity.h"
#include "global.h"
DECLARE_EXTERN_TASK(
common_drop_items,
{ cmplx *pos; ItemCounts items; }
);
DECLARE_EXTERN_TASK(
common_move,
{ cmplx *pos; MoveParams move_params; BoxedEntity ent; }
);
DECLARE_EXTERN_TASK(
common_move_ext,
{ cmplx *pos; MoveParams *move_params; BoxedEntity ent; }
);
DECLARE_EXTERN_TASK(
common_call_func,
{ void (*func)(void); }
);
DECLARE_EXTERN_TASK(
common_start_bgm,
{ const char *bgm; }
);
#define COMMON_CHARGE_SOUND_CHARGE "charge_generic"
#define COMMON_CHARGE_SOUND_DISCHARGE "discharge"
#define COMMON_CHARGE_SOUNDS { COMMON_CHARGE_SOUND_CHARGE, COMMON_CHARGE_SOUND_DISCHARGE }
DECLARE_EXTERN_TASK(
common_charge,
{
cmplx pos;
const Color *color;
int time;
BoxedEntity bind_to_entity;
const cmplx *anchor;
const Color *color_ref;
struct {
const char *charge;
const char *discharge;
} sound;
}
);
int common_charge(int time, const cmplx *anchor, cmplx offset, const Color *color)
attr_nonnull(2, 4);
int common_charge_static(int time, cmplx pos, const Color *color)
attr_nonnull(3);
int common_charge_custom(
int time,
const cmplx *anchor,
cmplx offset,
const Color *color,
const char *snd_charge,
const char *snd_discharge
) attr_nonnull(4);
void common_move_loop(cmplx *restrict pos, MoveParams *restrict mp);
INLINE Rect viewport_bounds(double margin) {
return (Rect) {
.top_left = CMPLX(margin, margin),
.bottom_right = CMPLX(VIEWPORT_W - margin, VIEWPORT_H - margin),
};
}
cmplx common_wander(cmplx origin, double dist, Rect bounds);
DECLARE_EXTERN_TASK(
common_set_bitflags,
{
uint *pflags;
uint mask;
uint set;
}
);
DECLARE_EXTERN_TASK(
common_kill_projectile,
{
BoxedProjectile proj;
}
);
DECLARE_EXTERN_TASK(
common_kill_enemy,
{
BoxedEnemy enemy;
}
);
#endif // IGUARD_common_tasks_h