-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmelee.h
36 lines (32 loc) · 893 Bytes
/
melee.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include <optional>
#include "defs.h"
#include "strings.h"
// 0 -- attacker misses
// 1 --defender unconscious
// 2 --defender dead
// 3 --defender lightly wounded
// 4 --defender seriously wounded
// 5 --staggered
// 6 --loses weapon
// 7 --hesitate(miss on free swing)
// 8 --sitting duck(crunch!)
enum class attack_state
{
missed,
unconscious,
killed,
light_wound,
serious_wound,
stagger,
lose_weapon,
hesitate,
sitting_duck
};
std::optional<attack_state> blow(const AdvP &hero, ObjectP villain, const tofmsgs *remarks, bool bhero, std::optional<int> out);
RAPPLIC(cure_clock);
RAPPLIC(diagnose);
int fight_strength(const AdvP &hero, bool adjust = true);
bool pres(const tofmsg &tbl, std::string_view a, std::string_view d, std::string_view w);
int villain_strength(const ObjectP &villain);
bool winning(const ObjectP &v, const AdvP &h);