Cleanup actions.h (#47)

This commit is contained in:
k3tamina 2022-06-18 10:04:25 +02:00 committed by GitHub
parent 8b37a22dd0
commit a449ce28ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 29 deletions

View File

@ -20,6 +20,7 @@
#include "perk.h"
#include "proto.h"
#include "proto_instance.h"
#include "proto_types.h"
#include "random.h"
#include "scripts.h"
#include "skill.h"
@ -34,10 +35,10 @@
#define MAX_KNOCKDOWN_DISTANCE 20
// 0x5106D0
int _action_in_explode = 0;
static int _action_in_explode = 0;
// 0x5106E0
const int gNormalDeathAnimations[DAMAGE_TYPE_COUNT] = {
static const int gNormalDeathAnimations[DAMAGE_TYPE_COUNT] = {
ANIM_DANCING_AUTOFIRE,
ANIM_SLICED_IN_HALF,
ANIM_CHARRED_BODY,
@ -48,7 +49,7 @@ const int gNormalDeathAnimations[DAMAGE_TYPE_COUNT] = {
};
// 0x5106FC
const int gMaximumBloodDeathAnimations[DAMAGE_TYPE_COUNT] = {
static const int gMaximumBloodDeathAnimations[DAMAGE_TYPE_COUNT] = {
ANIM_CHUNKS_OF_FLESH,
ANIM_SLICED_IN_HALF,
ANIM_FIRE_DANCE,
@ -58,6 +59,28 @@ const int gMaximumBloodDeathAnimations[DAMAGE_TYPE_COUNT] = {
ANIM_EXPLODED_TO_NOTHING,
};
static int actionKnockdown(Object* obj, int* anim, int maxDistance, int rotation, int delay);
static int _action_blood(Object* obj, int anim, int delay);
static int _pick_death(Object* attacker, Object* defender, Object* weapon, int damage, int anim, bool isFallingBack);
static int _check_death(Object* obj, int anim, int minViolenceLevel, bool isFallingBack);
static int _internal_destroy(Object* a1, Object* a2);
static void _show_damage_to_object(Object* a1, int damage, int flags, Object* weapon, bool isFallingBack, int knockbackDistance, int knockbackRotation, int a8, Object* a9, int a10);
static int _show_death(Object* obj, int anim);
static int _show_damage_extras(Attack* attack);
static void _show_damage(Attack* attack, int a2, int a3);
static int _action_melee(Attack* attack, int a2);
static int _action_ranged(Attack* attack, int a2);
static int _is_next_to(Object* a1, Object* a2);
static int _action_climb_ladder(Object* a1, Object* a2);
static int _pick_fall(Object* obj, int anim);
static int _report_explosion(Attack* attack, Object* a2);
static int _finished_explosion(Object* a1, Object* a2);
static int _compute_explosion_damage(int min, int max, Object* a3, int* a4);
static int _can_talk_to(Object* a1, Object* a2);
static int _talk_to(Object* a1, Object* a2);
static int _report_dmg(Attack* attack, Object* a2);
static int _compute_dmg_damage(int min, int max, Object* obj, int* a4, int damage_type);
// 0x410468
int actionKnockdown(Object* obj, int* anim, int maxDistance, int rotation, int delay)
{

View File

@ -3,26 +3,8 @@
#include "combat_defs.h"
#include "obj_types.h"
#include "proto_types.h"
extern int _action_in_explode;
extern const int gNormalDeathAnimations[DAMAGE_TYPE_COUNT];
extern const int gMaximumBloodDeathAnimations[DAMAGE_TYPE_COUNT];
int actionKnockdown(Object* obj, int* anim, int maxDistance, int rotation, int delay);
int _action_blood(Object* obj, int anim, int delay);
int _pick_death(Object* attacker, Object* defender, Object* weapon, int damage, int anim, bool isFallingBack);
int _check_death(Object* obj, int anim, int minViolenceLevel, bool isFallingBack);
int _internal_destroy(Object* a1, Object* a2);
void _show_damage_to_object(Object* a1, int damage, int flags, Object* weapon, bool isFallingBack, int knockbackDistance, int knockbackRotation, int a8, Object* a9, int a10);
int _show_death(Object* obj, int anim);
int _show_damage_extras(Attack* attack);
void _show_damage(Attack* attack, int a2, int a3);
int _action_attack(Attack* attack);
int _action_melee(Attack* attack, int a2);
int _action_ranged(Attack* attack, int a2);
int _is_next_to(Object* a1, Object* a2);
int _action_climb_ladder(Object* a1, Object* a2);
int _action_use_an_item_on_object(Object* a1, Object* a2, Object* a3);
int _action_use_an_object(Object* a1, Object* a2);
int actionPickUp(Object* critter, Object* item);
@ -31,18 +13,10 @@ int _action_skill_use(int a1);
int actionUseSkill(Object* a1, Object* a2, int skill);
bool _is_hit_from_front(Object* a1, Object* a2);
bool _can_see(Object* a1, Object* a2);
int _pick_fall(Object* obj, int anim);
bool _action_explode_running();
int actionExplode(int tile, int elevation, int minDamage, int maxDamage, Object* a5, bool a6);
int _report_explosion(Attack* attack, Object* a2);
int _finished_explosion(Object* a1, Object* a2);
int _compute_explosion_damage(int min, int max, Object* a3, int* a4);
int actionTalk(Object* a1, Object* a2);
int _can_talk_to(Object* a1, Object* a2);
int _talk_to(Object* a1, Object* a2);
void _action_dmg(int tile, int elevation, int minDamage, int maxDamage, int damageType, bool animated, bool bypassArmor);
int _report_dmg(Attack* attack, Object* a2);
int _compute_dmg_damage(int min, int max, Object* obj, int* a4, int damage_type);
bool actionCheckPush(Object* a1, Object* a2);
int actionPush(Object* a1, Object* a2);
int _action_can_talk_to(Object* a1, Object* a2);