Yume Project 3.0
Touhou-inspired Danmaku game made in C only
Chargement...
Recherche...
Aucune correspondance
Référence du fichier common_task.h

Déclarations de tâches et macros réutilisables pour les scènes et boss. Plus de détails...

#include "assets.h"
#include "bullet.h"
#include "coroutine/tasks.h"
#include "cotask.h"
#include "hud.h"
#include "moonlight_bg.h"
#include "obj.h"
#include "player.h"
#include "macro.h"
#include "game_state.h"
#include "pool.h"
#include <raylib.h>

Aller au code source de ce fichier.

Macros

#define RUN_SPELLCARD_W(ctx, pool, boss, spell, var, spell_name, life)
#define RUN_SPELLCARD(ctx, boss, spell, spell_name, life)
#define RUN_NONSPELL_W(ctx, pool, boss, nonspell, var, life)
#define RUN_NONSPELL(ctx, boss, nonspell, life)

Fonctions

 DECLARE_EXTERN_TASK (phase_timer, { CoEvent *event;int duration;})
 DECLARE_EXTERN_TASK (obj_GoTo, {Pool *pool;Entity objId;float x;float y;float speed;})
 DECLARE_EXTERN_TASK (play_anim_once, {Pool *pool;float x;float y;float scaleX;float scaleY;int sprite_id;float alpha;})
 DECLARE_EXTERN_TASK (boss_orb_effect, {Pool *pool;Entity boss;})
 DECLARE_EXTERN_TASK (boss_pentagram_effect, {Pool *pool;Entity boss;})
 DECLARE_EXTERN_TASK (boss_particle_spawner, {Pool *pool;Entity boss;})
 DECLARE_EXTERN_TASK (boss_distortion_effect, {Pool *pool;Entity boss;Vector2 *lens_center;float *lens_radius;float *lens_strength;})
 DECLARE_EXTERN_TASK (orb_explosion, {Pool *pool;float x;float y;})
 DECLARE_EXTERN_TASK (orb_explosion_big, {Pool *pool;float x;float y;})
 DECLARE_EXTERN_TASK (spellcard_bg_anim, {Pool *pool;int duration;})
 DECLARE_EXTERN_TASK (start_spellcard_sequence, {Pool *pool;Entity boss;const char *spell_name;int duration;})
 DECLARE_EXTERN_TASK (Bullet_spawn_accel, {Pool *p;Entity bullet;float speed;float accel;int accel_delay;})

Description détaillée

Déclarations de tâches et macros réutilisables pour les scènes et boss.

Contient les déclarations DECLARE_EXTERN_TASK pour les tâches fréquemment utilisées (timers, effets, mouvements d'objets, animations), ainsi que les macros d'orchestration RUN_SPELLCARD et RUN_NONSPELL employées par les scripts de stage/boss.

Documentation des macros

◆ RUN_NONSPELL

#define RUN_NONSPELL ( ctx,
boss,
nonspell,
life )
Valeur :
RUN_NONSPELL_W(ctx, (ctx)->pool, boss, nonspell, MACRO_ADDLINENUM(boss), life)
#define RUN_NONSPELL_W(ctx, pool, boss, nonspell, var, life)
Definition common_task.h:62
#define MACRO_ADDLINENUM(a)
Definition macro.h:5

◆ RUN_NONSPELL_W

#define RUN_NONSPELL_W ( ctx,
pool,
boss,
nonspell,
var,
life )
Valeur :
obj_SetMaxLife(pool, boss, life); \
obj_SetLife(pool, boss, life); \
obj_AddFlag(pool, boss, FLAG_INVINCIBLE); \
WAIT(120); \
obj_RemoveFlag(pool, boss, FLAG_INVINCIBLE); \
CoTask* MACRO_CONCAT(task_, var) = nonspell; \
BoxedTask MACRO_CONCAT(box_, var) = cotask_box(MACRO_CONCAT(task_, var)); \
while(!obj_IsDead(pool, boss)) { \
YIELD; \
} \
CANCEL_TASK(MACRO_CONCAT(box_, var)); \
Bullet_clear_bullets(ctx);
BoxedTask cotask_box(CoTask *task)
Emballer une task dans une boite (ref faible).
@ FLAG_INVINCIBLE
Definition flags.h:30
#define MACRO_CONCAT(a, b)
Definition macro.h:4
void moonlight_bg_set_mode(bool to_spellcard)
Change le mode d'affichage de l'arrière-plan (vers/depuis spellcard).
bool obj_IsDead(Pool *p, Entity objId)
Vérifie si un objet est mort.
Une BoxedTask est une référence faible a une task.
Definition cotask.h:25
Definition cotask_data.h:24
#define YIELD
Definition tasks.h:266

◆ RUN_SPELLCARD

#define RUN_SPELLCARD ( ctx,
boss,
spell,
spell_name,
life )
Valeur :
RUN_SPELLCARD_W(ctx, (ctx)->pool, boss, spell, MACRO_ADDLINENUM(boss), spell_name, life)
#define RUN_SPELLCARD_W(ctx, pool, boss, spell, var, spell_name, life)
Definition common_task.h:44

◆ RUN_SPELLCARD_W

#define RUN_SPELLCARD_W ( ctx,
pool,
boss,
spell,
var,
spell_name,
life )
Valeur :
obj_SetMaxLife(pool, boss, life); \
obj_SetLife(pool, boss, life); \
INVOKE_SUBTASK(start_spellcard_sequence, pool, boss, spell_name, 120); \
WAIT(120); \
CoTask* MACRO_CONCAT(task_, var) = spell; \
BoxedTask MACRO_CONCAT(box_, var) = cotask_box(MACRO_CONCAT(task_, var)); \
\
while(!obj_IsDead(pool, boss)) { \
YIELD; \
} \
\
HUD_clear_spellcard(); \
CANCEL_TASK(MACRO_CONCAT(box_, var)); \
Bullet_clear_bullets(ctx); \
moonlight_bg_set_mode(false);
void obj_SetMaxLife(Pool *p, Entity objId, int maxLife)
Définit la vie maximale d'un objet.

Documentation des fonctions

◆ DECLARE_EXTERN_TASK() [1/12]

DECLARE_EXTERN_TASK ( boss_distortion_effect ,
{Pool *pool;Entity boss;Vector2 *lens_center;float *lens_radius;float *lens_strength;}  )

◆ DECLARE_EXTERN_TASK() [2/12]

DECLARE_EXTERN_TASK ( boss_orb_effect ,
{Pool *pool;Entity boss;}  )

◆ DECLARE_EXTERN_TASK() [3/12]

DECLARE_EXTERN_TASK ( boss_particle_spawner ,
{Pool *pool;Entity boss;}  )

◆ DECLARE_EXTERN_TASK() [4/12]

DECLARE_EXTERN_TASK ( boss_pentagram_effect ,
{Pool *pool;Entity boss;}  )

◆ DECLARE_EXTERN_TASK() [5/12]

DECLARE_EXTERN_TASK ( Bullet_spawn_accel ,
{Pool *p;Entity bullet;float speed;float accel;int accel_delay;}  )

◆ DECLARE_EXTERN_TASK() [6/12]

DECLARE_EXTERN_TASK ( obj_GoTo ,
{Pool *pool;Entity objId;float x;float y;float speed;}  )

◆ DECLARE_EXTERN_TASK() [7/12]

DECLARE_EXTERN_TASK ( orb_explosion ,
{Pool *pool;float x;float y;}  )

◆ DECLARE_EXTERN_TASK() [8/12]

DECLARE_EXTERN_TASK ( orb_explosion_big ,
{Pool *pool;float x;float y;}  )

◆ DECLARE_EXTERN_TASK() [9/12]

DECLARE_EXTERN_TASK ( phase_timer ,
{ CoEvent *event;int duration;}  )

◆ DECLARE_EXTERN_TASK() [10/12]

DECLARE_EXTERN_TASK ( play_anim_once ,
{Pool *pool;float x;float y;float scaleX;float scaleY;int sprite_id;float alpha;}  )

◆ DECLARE_EXTERN_TASK() [11/12]

DECLARE_EXTERN_TASK ( spellcard_bg_anim ,
{Pool *pool;int duration;}  )

◆ DECLARE_EXTERN_TASK() [12/12]

DECLARE_EXTERN_TASK ( start_spellcard_sequence ,
{Pool *pool;Entity boss;const char *spell_name;int duration;}  )