WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Creature_Attack.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_CREATURE_ATTACK_HPP
3 #define WORLDSIM_CREATURE_ATTACK_HPP
4 
5 /* WorldSim: Creature_Attack
6  #include "Creature_Attack.hpp"
7 
8  Some creatures can choose from multiple attacks. Attacks can do different types of damage and status effects.
9 */
10 
11 
12 // Creatures get a choice of attacks to make, kinda like Pokemon or RPG battles.
13 // This should add some strategy and flavour to combat and makes it less of a grind.
14 // Wrestling and takedowns could also be options in some cases.
15 
17 {
18  public:
19 
20  std::string baseName; /* Action: <X> */
21  std::string actionName; /* The creature <X> you. */
22  std::string pastTenseName; /* That creature just <X> me. */
23 
24  short int reach; /* How far the attack can reach */
25 
26  // Area effect
27  // Status effect
28 
29  short int baseSlash; /* Balance of damage and bleed */
30  short int baseStab; /* Extra bleed and critical chance */
31  short int baseBlunt; /* High armour bypass, no bleed */
32 
33 
34  void generate( std::string _baseName, std::string _actionName, std::string _pastTenseName, short int _reach,
35  short int _baseSlash, short int _baseStab, short int _baseBlunt )
36  {
37  baseName = _baseName;
38  actionName = _actionName;
39  pastTenseName = _pastTenseName;
40 
41  reach = _reach;
42 
43  baseSlash = _baseSlash;
44  baseStab = _baseStab;
45  baseBlunt = _baseBlunt;
46  }
47 
48 };
49 
50 Creature_Attack atkBatClaw; /* Bat attacks with claws. */
51 Creature_Attack atkScreech; /* Bat screeches to disorient enemy */
52 
54 {
55  atkBatClaw.generate("Claw", "claws", "clawed", 1, 1,0,0);
56  atkScreech.generate("Screech", "screeches at", "screeched at", 5, 0,0,0);
57 }
58 
59 #endif
std::string pastTenseName
Definition: Creature_Attack.hpp:22
Creature_Attack atkBatClaw
Definition: Creature_Attack.hpp:50
short int baseBlunt
Definition: Creature_Attack.hpp:31
std::string baseName
Definition: Creature_Attack.hpp:20
short int baseStab
Definition: Creature_Attack.hpp:30
short int baseSlash
Definition: Creature_Attack.hpp:29
void initCreatureAttacks()
Definition: Creature_Attack.hpp:53
void generate(std::string _baseName, std::string _actionName, std::string _pastTenseName, short int _reach, short int _baseSlash, short int _baseStab, short int _baseBlunt)
Definition: Creature_Attack.hpp:34
Definition: Creature_Attack.hpp:16
std::string actionName
Definition: Creature_Attack.hpp:21
Creature_Attack atkScreech
Definition: Creature_Attack.hpp:51
short int reach
Definition: Creature_Attack.hpp:24