Define and setup internal class attributes.
This commit is contained in:
parent
e090bc775d
commit
21368f6f95
46
Crawler/Class.cpp
Normal file
46
Crawler/Class.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include "Class.h"
|
||||
|
||||
std::map<Class,ClassData>CLASS_DATA={
|
||||
{WARRIOR,{
|
||||
"Warrior",WARRIOR,
|
||||
{"Block",15,VERY_DARK_BLUE,DARK_BLUE},
|
||||
{"Battlecry",12},
|
||||
{"Ground Slam",15},
|
||||
{"Sonic Slash",40}
|
||||
}},
|
||||
{THIEF,{
|
||||
"Thief",THIEF,
|
||||
{"???",15,VERY_DARK_BLUE,DARK_BLUE},
|
||||
{"???",12},
|
||||
{"???",15},
|
||||
{"???",40}
|
||||
}},
|
||||
{RANGER,{
|
||||
"Ranger",RANGER,
|
||||
{"Retreat",7,VERY_DARK_BLUE,DARK_BLUE},
|
||||
{"Rapid Fire",12},
|
||||
{"Charged Shot",15},
|
||||
{"Multishot",25}
|
||||
}},
|
||||
{BARD,{
|
||||
"Bard",BARD,
|
||||
{"???",7,VERY_DARK_BLUE,DARK_BLUE},
|
||||
{"???",12},
|
||||
{"???",15},
|
||||
{"???",25}
|
||||
}},
|
||||
{WIZARD,{
|
||||
"Wizard",WIZARD,
|
||||
{"Teleport",8,VERY_DARK_BLUE,DARK_BLUE},
|
||||
{"Firebolt",6},
|
||||
{"Lightning Bolt",6},
|
||||
{"Meteor",40}
|
||||
}},
|
||||
{WITCH,{
|
||||
"Witch",WITCH,
|
||||
{"???",8,VERY_DARK_BLUE,DARK_BLUE},
|
||||
{"???",6},
|
||||
{"???",6},
|
||||
{"???",40}
|
||||
}},
|
||||
};
|
12
Crawler/Class.h
Normal file
12
Crawler/Class.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include "Ability.h"
|
||||
#include "olcPixelGameEngine.h"
|
||||
|
||||
enum Class{
|
||||
WARRIOR,THIEF,RANGER,BARD,WIZARD,WITCH
|
||||
};
|
||||
struct ClassData{
|
||||
std::string name;
|
||||
Class cl;
|
||||
Ability rightClickAbility,ability1,ability2,ability3;
|
||||
};
|
@ -4,6 +4,7 @@
|
||||
#include "DamageNumber.h"
|
||||
#include "Bullet.h"
|
||||
#include "Ability.h"
|
||||
#include "Class.h"
|
||||
#include "DEFINES.h"
|
||||
|
||||
//192x192
|
||||
@ -55,6 +56,7 @@ bool Crawler::OnUserCreate(){
|
||||
player.AddAnimation(AnimationState::SWINGSWORD_W);
|
||||
view=TileTransformedView{GetScreenSize(),{1,1}};
|
||||
|
||||
player.SetClass(WARRIOR);
|
||||
player.SetPos({4*24,4*24});
|
||||
player.UpdateAnimation(AnimationState::IDLE_S);
|
||||
|
||||
|
@ -132,6 +132,7 @@
|
||||
<ClInclude Include="Ability.h" />
|
||||
<ClInclude Include="Animation.h" />
|
||||
<ClInclude Include="Bullet.h" />
|
||||
<ClInclude Include="Class.h" />
|
||||
<ClInclude Include="Crawler.h" />
|
||||
<ClInclude Include="DamageNumber.h" />
|
||||
<ClInclude Include="DEFINES.h" />
|
||||
@ -148,6 +149,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Ability.cpp" />
|
||||
<ClCompile Include="Bullet.cpp" />
|
||||
<ClCompile Include="Class.cpp" />
|
||||
<ClCompile Include="Crawler.cpp" />
|
||||
<ClCompile Include="DamageNumber.cpp" />
|
||||
<ClCompile Include="Effect.cpp" />
|
||||
|
@ -60,6 +60,9 @@
|
||||
<ClInclude Include="Ability.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Class.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Player.cpp">
|
||||
@ -89,6 +92,9 @@
|
||||
<ClCompile Include="Ability.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Class.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
|
@ -5,4 +5,5 @@
|
||||
#define INCLUDE_DAMAGENUMBER_LIST extern std::vector<DamageNumber>DAMAGENUMBER_LIST;
|
||||
#define INCLUDE_game extern Crawler*game;
|
||||
#define INCLUDE_MONSTER_DATA extern std::map<MonsterName,MonsterData>MONSTER_DATA;
|
||||
#define INCLUDE_BULLET_LIST extern std::vector<Bullet>BULLET_LIST;
|
||||
#define INCLUDE_BULLET_LIST extern std::vector<Bullet>BULLET_LIST;
|
||||
#define INCLUDE_CLASS_DATA extern std::map<Class,ClassData>CLASS_DATA;
|
@ -22,6 +22,8 @@ the Battlecry slow is primarly ment to make it easier to catch up with range uni
|
||||
|
||||
|
||||
Ranger
|
||||
Ranger und bard shoot arrow. little higher cooldown to balance range advantage. like 0.6 maybe.
|
||||
|
||||
Rightclick - Retreat
|
||||
Backwardsjump
|
||||
leap 250 Range backwards.
|
||||
@ -42,7 +44,12 @@ every arrow normal autohit dmg. (can be used as shotgun against large foes for 6
|
||||
25 sec. cd
|
||||
55 Mana
|
||||
|
||||
|
||||
|
||||
Wizard
|
||||
Wizard and witch have different attacks. Both Probably around 0.85 sec cd. Skill cooldowns will be lower to balance that out.
|
||||
Wizard energy bolts that are just like arrows normal projectiles
|
||||
|
||||
Rightclick - Teleport
|
||||
Teleports to a location within 650 Range
|
||||
cd 8 sec.
|
||||
|
@ -9,16 +9,20 @@ INCLUDE_MONSTER_LIST
|
||||
INCLUDE_ANIMATION_DATA
|
||||
INCLUDE_SPAWNER_LIST
|
||||
INCLUDE_DAMAGENUMBER_LIST
|
||||
INCLUDE_CLASS_DATA
|
||||
INCLUDE_game
|
||||
|
||||
const float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
||||
|
||||
Player::Player():
|
||||
state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN),
|
||||
rightClickAbility("Block",15,VERY_DARK_BLUE,DARK_BLUE),
|
||||
ability1("Battlecry",12),
|
||||
ability2("Ground Slam",15),
|
||||
ability3("Sonic Slash",40){
|
||||
state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN){}
|
||||
|
||||
void Player::SetClass(Class cl){
|
||||
this->cl=CLASS_DATA[cl].cl;
|
||||
rightClickAbility=CLASS_DATA[cl].rightClickAbility;
|
||||
ability1=CLASS_DATA[cl].ability1;
|
||||
ability2=CLASS_DATA[cl].ability2;
|
||||
ability3=CLASS_DATA[cl].ability3;
|
||||
}
|
||||
|
||||
void Player::SetX(float x){
|
||||
|
@ -4,10 +4,12 @@
|
||||
#include "Monster.h"
|
||||
#include "State.h"
|
||||
#include "Ability.h"
|
||||
#include "Class.h"
|
||||
|
||||
struct Player{
|
||||
friend class Crawler;
|
||||
private:
|
||||
Class cl=WARRIOR;
|
||||
int hp=100,maxhp=hp;
|
||||
int atk=10;
|
||||
vf2d pos;
|
||||
@ -42,6 +44,7 @@ private:
|
||||
void SetY(float y);
|
||||
void SetZ(float z);
|
||||
void SetPos(vf2d pos);
|
||||
void SetClass(Class cl);
|
||||
protected:
|
||||
public:
|
||||
Player();
|
||||
|
Loading…
x
Reference in New Issue
Block a user