Dumb-ways-to-memorize
2D game
|
#include "globals.h"
#include "parsefunction.h"
#include "parsepowerup.h"
#include "parseobject.h"
#include "entity.h"
#include "mystrings.h"
#include <jsmn.h>
#include <string.h>
#include <stdio.h>
#include "dumb_physics.h"
#include "player.h"
Go to the source code of this file.
Functions | |
void | Move (entity_t *targ, entity_t *info) |
void | Destroy (entity_t *targ, entity_t *info) |
void | Spawn (entity_t *targ, entity_t *info) |
void | Edit (entity_t *targ, entity_t *info) |
void | Nullify (entity_t *targ, entity_t *info) |
void | UpdateNormal (power_t *power) |
void | UpdateInfinite (power_t *power) |
int | GetUseType (const char *var, int *useType) |
void | CallInfo (power_t *self) |
power_t * | ParseToPowerUp (object_t *power, char *g_str) |
power_t * | FindPower (char *str) |
void | UsePower (power_t *power) |
Variables | |
char * | InteractionNames [] = {"move", "destroy", "spawn", "edit", "nullify", 0} |
void | InteractionSymbols = {Move, Destroy, Spawn, Edit, Nullify, 0} |
power_t * | gCurrentPowerUp = NULL |
vec2_t * | mousePos = NULL |
int * | keyPower = NULL |
void CallInfo | ( | power_t * | self | ) |
Call information functions for the power_up.
[in,out] | self | If non-null, the class instance that this method operates on. |
Definition at line 142 of file parsepowerup.c.
References GetMousePos(), GetX(), GetXMouse(), gPlayer, INFO_BOTH, INFO_BUTTON, INFO_MOUSE, and keyPower.
Referenced by ParseToPowerUp().
void Destroy | ( | entity_t * | targ, |
entity_t * | info | ||
) |
Destroys target.
[in,out] | targ | If non-null, the targ. |
[in,out] | info | If non-null, the information. |
Definition at line 32 of file parsepowerup.c.
References FreeEntity().
void Edit | ( | entity_t * | targ, |
entity_t * | info | ||
) |
Edits the target with values from info.
[in,out] | targ | If non-null, the targ. |
[in,out] | info | If non-null, the information. |
Definition at line 68 of file parsepowerup.c.
power_t* FindPower | ( | char * | str | ) |
Searches for the first power with matching name str.
[in,out] | str | If non-null, the string. |
Definition at line 264 of file parsepowerup.c.
References CountMem(), and gPowerUps.
Referenced by UpdatePowerSelectMenu().
int GetUseType | ( | const char * | var, |
int * | useType | ||
) |
Gets the usetype from var, and puts it in useType.
var | The variable. | |
[in,out] | useType | If non-null, type of the use. |
Definition at line 124 of file parsepowerup.c.
Referenced by ParseToPowerUp().
void Move | ( | entity_t * | targ, |
entity_t * | info | ||
) |
Moves the target to position given by info.
[in,out] | targ | If non-null, the targ. |
[in,out] | info | If non-null, the information. |
Definition at line 20 of file parsepowerup.c.
void Nullify | ( | entity_t * | targ, |
entity_t * | info | ||
) |
Nullifies the entity by removing the think function of targ.
[in,out] | targ | If non-null, the targ. |
[in,out] | info | If non-null, the information. |
Definition at line 90 of file parsepowerup.c.
power_t* ParseToPowerUp | ( | object_t * | power, |
char * | str | ||
) |
Parses object/str data to a power up.
[in,out] | power | If non-null, the power. |
[in,out] | str | If non-null, the string. |
Definition at line 157 of file parsepowerup.c.
References CallInfo(), FindCachedEntity(), FindValue(), FunctionNames, GetUseType(), INFINITE, INFO_BOTH, INFO_NONE, InteractionNames, InteractionSymbols, keyPower, ParseToFunction(), POWER_ENTITY_STR, POWER_INPUT_TYPE_STR, POWER_INTERACTION_STR, POWER_TARGET_STR, POWER_USE_TYPE_STR, STATIC, UpdateInfinite(), and UpdateNormal().
Referenced by LoadPowerUpData().
void Spawn | ( | entity_t * | targ, |
entity_t * | info | ||
) |
Spawns entity from info to position of targ.
[in,out] | targ | If non-null, the targ. |
[in,out] | info | If non-null, the information. |
Definition at line 41 of file parsepowerup.c.
References ANIMATION_IDLE, ENTITY_DIR_RIGHT, InitNewEntity(), PHYSICS_BASE_SPEED_X, and Vec2Add().
Referenced by AttackAI().
void UpdateInfinite | ( | power_t * | power | ) |
Updates an infinite use power_up
[in,out] | power | If non-null, the power. |
Definition at line 119 of file parsepowerup.c.
References gPlayer.
Referenced by ParseToPowerUp().
void UpdateNormal | ( | power_t * | power | ) |
Updates a normal use power_up, with uses > 0.
[in,out] | power | If non-null, the power. |
Definition at line 99 of file parsepowerup.c.
References gPlayer.
Referenced by ParseToPowerUp().
void UsePower | ( | power_t * | power | ) |
Uses the power, more like a macro then anything.
[in,out] | power | If non-null, the power. |
Definition at line 285 of file parsepowerup.c.
Referenced by InitPlayer().
power_t* gCurrentPowerUp = NULL |
The currently loaded power_up
Definition at line 16 of file parsepowerup.c.
Referenced by DoPlayerThink(), ThinkPlayer(), and UpdatePowerSelectMenu().
char* InteractionNames[] = {"move", "destroy", "spawn", "edit", "nullify", 0} |
The interaction names, which deal with what function power does
Definition at line 13 of file parsepowerup.c.
Referenced by ParseToPowerUp().
The interaction symbol for the functions
Definition at line 14 of file parsepowerup.c.
Referenced by ParseToPowerUp().
int* keyPower = NULL |
The key press related to using the power
Definition at line 18 of file parsepowerup.c.
Referenced by CallInfo(), and ParseToPowerUp().
vec2_t* mousePos = NULL |
The mouse position
Definition at line 17 of file parsepowerup.c.