Class ability descriptions added. Full render image paths now defined. Moved some class information around.

pull/28/head
sigonasr2 1 year ago
parent 0fdfa65ddf
commit e189d4b516
  1. 6
      Crawler/Ability.cpp
  2. 3
      Crawler/Ability.h
  3. 20
      Crawler/CharacterInfoWindow.cpp
  4. 2
      Crawler/Class.h
  5. 74
      Crawler/ClassInfo.h
  6. 2
      Crawler/ClassSelectionWindow.cpp
  7. 1
      Crawler/Crawler.cpp
  8. 1
      Crawler/Crawler.vcxproj
  9. 3
      Crawler/Crawler.vcxproj.filters
  10. 2
      Crawler/GameState.cpp
  11. 2
      Crawler/Menu.cpp
  12. 1
      Crawler/MonsterAttribute.h
  13. 6
      Crawler/Player.h
  14. 2
      Crawler/Version.h
  15. 10
      Crawler/assets/config/classes/Ranger.txt
  16. 6
      Crawler/assets/config/classes/Thief.txt
  17. 6
      Crawler/assets/config/classes/Trapper.txt
  18. 10
      Crawler/assets/config/classes/Warrior.txt
  19. 6
      Crawler/assets/config/classes/Witch.txt
  20. 10
      Crawler/assets/config/classes/Wizard.txt
  21. BIN
      Crawler/assets/knight_full_render1.png
  22. BIN
      Crawler/assets/unknown_full_render.png

@ -13,6 +13,6 @@ PrecastData::PrecastData(float castTime,float range,float size)
InputGroup Ability::DEFAULT;
Ability::Ability()
:name("???"),shortName("???"),cooldown(0),COOLDOWN_TIME(0),input(&DEFAULT){};
Ability::Ability(std::string name,std::string shortName,float cooldownTime,int manaCost,InputGroup*input,std::string icon,Pixel barColor1,Pixel barColor2,PrecastData precastInfo,bool canCancelCast)
:name(name),shortName(shortName),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),input(input),icon("Ability Icons/"+icon),barColor1(barColor1),barColor2(barColor2),precastInfo(precastInfo),canCancelCast(canCancelCast){}
:name("???"),shortName("???"),description("???"),cooldown(0),COOLDOWN_TIME(0),input(&DEFAULT){};
Ability::Ability(std::string name,std::string shortName,std::string description,float cooldownTime,int manaCost,InputGroup*input,std::string icon,Pixel barColor1,Pixel barColor2,PrecastData precastInfo,bool canCancelCast)
:name(name),shortName(shortName),description(description),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),input(input),icon("Ability Icons/"+icon),barColor1(barColor1),barColor2(barColor2),precastInfo(precastInfo),canCancelCast(canCancelCast){}

@ -20,6 +20,7 @@ struct PrecastData{
struct Ability{
std::string name="";
std::string shortName="";
std::string description="";
float cooldown=0;
float COOLDOWN_TIME=0;
int manaCost=0;
@ -32,5 +33,5 @@ struct Ability{
static InputGroup DEFAULT;
Ability();
//NOTE: icon expects the actual name relative to the "Ability Icons" directory for this constructor!
Ability(std::string name,std::string shortName,float cooldownTime,int manaCost,InputGroup*input,std::string icon,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED,PrecastData precastInfo={},bool canCancelCast=false);
Ability(std::string name,std::string shortName,std::string description,float cooldownTime,int manaCost,InputGroup*input,std::string icon,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED,PrecastData precastInfo={},bool canCancelCast=false);
};

@ -4,23 +4,37 @@
#include "Menu.h"
#include "MenuLabel.h"
#include "CharacterRotatingDisplay.h"
#include "ClassInfo.h"
INCLUDE_game
INCLUDE_GFX
INCLUDE_DATA
typedef Attribute A;
void Menu::InitializeClassInfoWindow(){
Menu*classInfoWindow=CreateMenu(CLASS_INFO,CENTERED,game->GetScreenSize()-vi2d{64,64});
MenuLabel*label=new MenuLabel(CLASS_INFO,{{0,8},{classInfoWindow->size.x,16}},"Warrior",2,true,true);
Menu*classSelectionWindow=Menu::menus[CLASS_SELECTION];
ClassInfo data=classutils::GetClassInfo(classSelectionWindow->S(A::CLASS_SELECTION));
MenuLabel*label=new MenuLabel(CLASS_INFO,{{0,8},{classInfoWindow->size.x,16}},data.className,2,true,true);
classInfoWindow->AddComponent("Class Name",label);
CharacterRotatingDisplay*classDisplay=new CharacterRotatingDisplay(CLASS_INFO,{{0,0},{72,120}},GFX["knight_full_render1.png"].Decal());
CharacterRotatingDisplay*classDisplay=new CharacterRotatingDisplay(CLASS_INFO,{{0,0},{72,120}},GFX[data.classFullImgName].Decal());
classInfoWindow->AddComponent("Rotating Character Display",classDisplay);
MenuLabel*baseStatsLabel=new MenuLabel(CLASS_INFO,{{2*classInfoWindow->size.x/3,classInfoWindow->pos.y+20},{classInfoWindow->size.x/3,16}},"Base Stats",1,true,true);
vf2d baseStatsLabelPos={classInfoWindow->size.x/3,classInfoWindow->pos.y+20};
vf2d labelSize={2*classInfoWindow->size.x/3,16};
MenuLabel*baseStatsLabel=new MenuLabel(CLASS_INFO,{baseStatsLabelPos,labelSize},"Base Stats",1,true,true);
MenuLabel*healthDisplayLabel=new MenuLabel(CLASS_INFO,{baseStatsLabelPos+vf2d{0,16*1+8},labelSize},"Health: "+std::to_string(data.baseHealth)+" + "+std::to_string(data.healthGrowthRate).substr(0,3)+" per level",1,false,true);
MenuLabel*atkDisplayLabel=new MenuLabel(CLASS_INFO,{baseStatsLabelPos+vf2d{0,16*2+8},labelSize},"Attack: "+std::to_string(data.baseAtk)+" + "+std::to_string(data.atkGrowthRate).substr(0,3)+" per level",1,false,true);
classInfoWindow->AddComponent("Base Stats Text",baseStatsLabel);
classInfoWindow->AddComponent("Health Display Text",healthDisplayLabel);
classInfoWindow->AddComponent("Attack Display Text",atkDisplayLabel);
}

@ -3,6 +3,8 @@
#include "Animation.h"
#include "olcPixelGameEngine.h"
#undef GetClassInfo
//Classes have bit-wise operator capabilities.
enum Class{
ANY=0,

@ -0,0 +1,74 @@
#pragma once
#include <string>
#include "Player.h"
INCLUDE_DATA
struct ClassInfo{
std::string className;
std::string classFullImgName;
int baseHealth;
int baseAtk;
float healthGrowthRate;
float atkGrowthRate;
Ability*ability1;
Ability*ability2;
Ability*ability3;
Ability*rightClickAbility;
};
class classutils{
public:
static inline ClassInfo GetClassInfo(std::string className){
ClassInfo data{
DATA.GetProperty(className+".ClassName").GetString(),
DATA.GetProperty(className+".FullRender").GetString(),
DATA.GetProperty(className+".BaseHealth").GetInt(),
DATA.GetProperty(className+".BaseAtk").GetInt(),
float(DATA.GetProperty(className+".HealthGrowthRate").GetReal()),
float(DATA.GetProperty(className+".AtkGrowthRate").GetReal())
};
if(className=="Warrior"){
data.rightClickAbility=&Warrior::rightClickAbility;
data.ability1=&Warrior::ability1;
data.ability2=&Warrior::ability2;
data.ability3=&Warrior::ability3;
}else
if(className=="Wizard"){
data.rightClickAbility=&Wizard::rightClickAbility;
data.ability1=&Wizard::ability1;
data.ability2=&Wizard::ability2;
data.ability3=&Wizard::ability3;
}else
if(className=="Ranger"){
data.rightClickAbility=&Ranger::rightClickAbility;
data.ability1=&Ranger::ability1;
data.ability2=&Ranger::ability2;
data.ability3=&Ranger::ability3;
}else
if(className=="Trapper"){
data.rightClickAbility=&Trapper::rightClickAbility;
data.ability1=&Trapper::ability1;
data.ability2=&Trapper::ability2;
data.ability3=&Trapper::ability3;
}else
if(className=="Witch"){
data.rightClickAbility=&Witch::rightClickAbility;
data.ability1=&Witch::ability1;
data.ability2=&Witch::ability2;
data.ability3=&Witch::ability3;
}else
if(className=="Thief"){
data.rightClickAbility=&Thief::rightClickAbility;
data.ability1=&Thief::ability1;
data.ability2=&Thief::ability2;
data.ability3=&Thief::ability3;
}else{
std::cout<<"WARNING! Could not get class info for non-existent class "+className+"!";
throw;
}
return data;
}
};

@ -9,4 +9,6 @@ typedef Attribute A;
void Menu::InitializeClassSelectionWindow(){
Menu*classSelectionWindow=CreateMenu(CLASS_SELECTION,CENTERED,game->GetScreenSize()-vi2d{4,4});
classSelectionWindow->S(A::CLASS_SELECTION)="Warrior"; //Default selected class.
}

@ -140,7 +140,6 @@ bool Crawler::OnUserCreate(){
LoadLevel(LEVEL_NAMES["starting_map"_S]);
InitializeClasses();
ChangePlayerClass(WARRIOR);
//Warrior::ability4=Ranger::ability1; //Class ability swapping demonstration.
GameState::Initialize();

@ -266,6 +266,7 @@
<ClInclude Include="BulletTypes.h" />
<ClInclude Include="CharacterRotatingDisplay.h" />
<ClInclude Include="Class.h" />
<ClInclude Include="ClassInfo.h" />
<ClInclude Include="config.h" />
<ClInclude Include="Crawler.h" />
<ClInclude Include="DamageNumber.h" />

@ -198,6 +198,9 @@
<ClInclude Include="CharacterRotatingDisplay.h">
<Filter>Header Files\Interface</Filter>
</ClInclude>
<ClInclude Include="ClassInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Player.cpp">

@ -6,5 +6,5 @@ void GameState::Initialize(){
NEW_STATE(States::GAME_RUN,State_GameRun);
NEW_STATE(States::MAIN_MENU,State_MainMenu);
GameState::ChangeState(States::GAME_RUN);
GameState::ChangeState(States::MAIN_MENU);
}

@ -30,8 +30,8 @@ void Menu::InitializeMenus(){
InitializeTestMenu();
InitializeTestSubMenu();
InitializeInventoryWindow();
InitializeClassInfoWindow();
InitializeClassSelectionWindow();
InitializeClassInfoWindow();
InitializeMainMenuWindow();
for(MenuType type=TEST;type<MenuType::ENUM_END;type=MenuType(int(type+1))){

@ -29,4 +29,5 @@ enum class Attribute{
HITS_UNTIL_DEATH, //When this is set, it is reduced by 1 each time the monster is hit.
INDEXED_THEME,
SCROLL_OFFSET,
CLASS_SELECTION, //A class name that represents what the menu's class is.
};

@ -4,12 +4,12 @@
#include "Monster.h"
#include "State.h"
#include "Ability.h"
#include "Class.h"
#include "Buff.h"
#include "Pathfinding.h"
#include "DamageNumber.h"
#include "config.h"
#include "Key.h"
#include "Class.h"
#undef GetClassName
@ -363,6 +363,7 @@ struct Witch:Player{
class::rightClickAbility={ \
#class".Right Click Ability.Name"_S, \
#class".Right Click Ability.Short Name"_S, \
#class".Right Click Ability.Description"_S, \
#class".Right Click Ability.Cooldown"_F, \
#class".Right Click Ability.Mana Cost"_I, \
&KEY_DEFENSIVE, \
@ -375,6 +376,7 @@ struct Witch:Player{
class::ability1={ \
#class".Ability 1.Name"_S, \
#class".Ability 1.Short Name"_S, \
#class".Ability 1.Description"_S, \
#class".Ability 1.Cooldown"_F, \
#class".Ability 1.Mana Cost"_I, \
&KEY_ABILITY1, \
@ -387,6 +389,7 @@ struct Witch:Player{
class::ability2={ \
#class".Ability 2.Name"_S, \
#class".Ability 2.Short Name"_S, \
#class".Ability 2.Description"_S, \
#class".Ability 2.Cooldown"_F, \
#class".Ability 2.Mana Cost"_I, \
&KEY_ABILITY2, \
@ -399,6 +402,7 @@ struct Witch:Player{
class::ability3={ \
#class".Ability 3.Name"_S, \
#class".Ability 3.Short Name"_S, \
#class".Ability 3.Description"_S, \
#class".Ability 3.Cooldown"_F, \
#class".Ability 3.Mana Cost"_I, \
&KEY_ABILITY3, \

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 2231
#define VERSION_BUILD 2248
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -10,6 +10,8 @@ Ranger
# Amount of attack gained per level.
AtkGrowthRate = 0.8
FullRender = unknown_full_render.png
Auto Attack
{
DamageMult = 1
@ -31,6 +33,8 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
Description = Quickly steps backwards to avoid incoming attacks.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
@ -54,6 +58,8 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
Description = Shoots five arrows rapidly at a target location.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
@ -86,6 +92,8 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
Description = Fires an ultrasonic arrow towards a location, piercing everything it comes in contact with.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
@ -116,6 +124,8 @@ Ranger
# Whether or not this ability cancels casts.
CancelCast = 0
Description = The Ranger prepares and fires a fan of densely packed arrows.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192

@ -10,10 +10,13 @@ Thief
# Amount of attack gained per level.
AtkGrowthRate = 0.2
FullRender = unknown_full_render.png
Right Click Ability
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 8
Mana Cost = 5
@ -32,6 +35,7 @@ Thief
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 6
Mana Cost = 30
@ -50,6 +54,7 @@ Thief
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 6
Mana Cost = 25
@ -68,6 +73,7 @@ Thief
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 40
Mana Cost = 75

@ -10,10 +10,13 @@ Trapper
# Amount of attack gained per level.
AtkGrowthRate = 0.2
FullRender = unknown_full_render.png
Right Click Ability
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 8
Mana Cost = 5
@ -32,6 +35,7 @@ Trapper
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 6
Mana Cost = 30
@ -50,6 +54,7 @@ Trapper
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 6
Mana Cost = 25
@ -68,6 +73,7 @@ Trapper
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 40
Mana Cost = 75

@ -10,6 +10,8 @@ Warrior
# Amount of attack gained per level.
AtkGrowthRate = 0.2
FullRender = knight_full_render1.png
Auto Attack
{
DamageMult = 1
@ -30,6 +32,8 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
Description = Blocks incoming damage for a brief period of time.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
@ -56,6 +60,8 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
Description = A Battlecry that boosts the Warrior's Damage and Defense capabilities for some time.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
@ -102,6 +108,8 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
Description = Leaps into the air and then dives into the ground, destroying everything around the Warrior in the process.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
@ -134,6 +142,8 @@ Warrior
# Whether or not this ability cancels casts.
CancelCast = 0
Description = A large sonic wave projectile is released from the Warrior's sword.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192

@ -10,10 +10,13 @@ Witch
# Amount of attack gained per level.
AtkGrowthRate = 0.2
FullRender = unknown_full_render.png
Right Click Ability
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 8
Mana Cost = 5
@ -32,6 +35,7 @@ Witch
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 6
Mana Cost = 30
@ -50,6 +54,7 @@ Witch
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 6
Mana Cost = 25
@ -68,6 +73,7 @@ Witch
{
Name = ???
Short Name = ???
Description = ???
Icon = block.png
Cooldown = 40
Mana Cost = 75

@ -10,6 +10,8 @@ Wizard
# Amount of attack gained per level.
AtkGrowthRate = 0.5
FullRender = unknown_full_render.png
Auto Attack
{
DamageMult = 1
@ -43,6 +45,8 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 1
Description = Vanish and reappear at a new target location.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 0, 0, 64, 192
Cooldown Bar Color 2 = 0, 0, 128, 192
@ -82,6 +86,8 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
Description = Shoots an explosive bolt of fire.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
@ -148,6 +154,8 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
Description = Shoot an electrically charged bolt at enemies, spreads to two other targets upon impact.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192
@ -204,6 +212,8 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
Description = After channeling, summons a meteorite from the heavens to crash into the planet.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
Cooldown Bar Color 1 = 64, 0, 0, 192
Cooldown Bar Color 2 = 128, 0, 0, 192

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save