Corrected amount values drawn from inventory amt function and GetItemCount() functions. Added ability for Loadout items to be used on the field. Treated as abilities, and setup keybinds.

pull/28/head
sigonasr2 1 year ago
parent 933fc16cce
commit 45c6d22ee0
  1. 2
      Crawler/Ability.cpp
  2. 3
      Crawler/Ability.h
  3. 43
      Crawler/Crawler.cpp
  4. 35
      Crawler/Item.cpp
  5. 12
      Crawler/Item.h
  6. 51
      Crawler/Player.cpp
  7. 17
      Crawler/Player.h
  8. 2
      Crawler/Version.h
  9. 4
      Crawler/assets/Campaigns/1_1_v2.tmx
  10. 2
      Crawler/assets/config/configuration.txt
  11. 54
      Crawler/assets/config/items/ItemDatabase.txt
  12. 5
      Crawler/assets/config/items/items.txt

@ -48,4 +48,4 @@ InputGroup Ability::DEFAULT;
Ability::Ability() Ability::Ability()
:name("???"),shortName("???"),description("???"),cooldown(0),COOLDOWN_TIME(0),input(&DEFAULT){}; :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) 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){} :name(name),shortName(shortName),description(description),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),input(input),icon(icon),barColor1(barColor1),barColor2(barColor2),precastInfo(precastInfo),canCancelCast(canCancelCast){}

@ -62,6 +62,9 @@ struct Ability{
bool canCancelCast=false; bool canCancelCast=false;
InputGroup*input; InputGroup*input;
std::string icon; std::string icon;
//Ability action function, returns true if the ability can be casted, otherwise returns false.
// Argument 1: Player* - player pointer
// Argument 2: vf2d - The returned precast target position (if the ability needs to be aimed, otherwise {})
std::function<bool(Player*,vf2d)>action=[](Player*,vf2d){return false;}; std::function<bool(Player*,vf2d)>action=[](Player*,vf2d){return false;};
static InputGroup DEFAULT; static InputGroup DEFAULT;
Ability(); Ability();

@ -1176,6 +1176,7 @@ void Crawler::RenderHud(){
if("debug_player_info"_I){ if("debug_player_info"_I){
DrawShadowStringDecal({0,128},player->GetPos().str()); DrawShadowStringDecal({0,128},player->GetPos().str());
DrawShadowStringDecal({0,136},"Spd: "+std::to_string(player->GetMoveSpdMult())); DrawShadowStringDecal({0,136},"Spd: "+std::to_string(player->GetMoveSpdMult()));
DrawShadowStringDecal({0,92},"Loadout Slot 1 Qty: "+std::to_string(GetLoadoutItem(0).Amt()));
DrawShadowStringDecal({0,1},"Selection: "+Menu::menus[INVENTORY]->selection.str()); DrawShadowStringDecal({0,1},"Selection: "+Menu::menus[INVENTORY]->selection.str());
DrawShadowStringDecal({0,12},"Button Hold Time: "+std::to_string(Menu::menus[INVENTORY]->buttonHoldTime)); DrawShadowStringDecal({0,12},"Button Hold Time: "+std::to_string(Menu::menus[INVENTORY]->buttonHoldTime));
}} }}
@ -1829,6 +1830,9 @@ void Crawler::InitializeDefaultKeybinds(){
Player::KEY_ABILITY3.AddKeybind({KEY,R}); Player::KEY_ABILITY3.AddKeybind({KEY,R});
Player::KEY_ABILITY4.AddKeybind({KEY,F}); Player::KEY_ABILITY4.AddKeybind({KEY,F});
Player::KEY_DEFENSIVE.AddKeybind({MOUSE,Mouse::RIGHT}); Player::KEY_DEFENSIVE.AddKeybind({MOUSE,Mouse::RIGHT});
Player::KEY_ITEM1.AddKeybind({KEY,K1});
Player::KEY_ITEM2.AddKeybind({KEY,K2});
Player::KEY_ITEM3.AddKeybind({KEY,K3});
KEY_ATTACK.AddKeybind({MOUSE,Mouse::LEFT}); KEY_ATTACK.AddKeybind({MOUSE,Mouse::LEFT});
KEY_LEFT.AddKeybind({KEY,LEFT}); KEY_LEFT.AddKeybind({KEY,LEFT});
KEY_LEFT.AddKeybind({KEY,A}); KEY_LEFT.AddKeybind({KEY,A});
@ -2038,6 +2042,44 @@ void Crawler::SetLoadoutItem(int slot,std::string itemName){
if(Inventory::GetItemCount(itemName)>0){ if(Inventory::GetItemCount(itemName)>0){
GetLoadoutItem(slot)=Inventory::GetItem(itemName); GetLoadoutItem(slot)=Inventory::GetItem(itemName);
GetLoadoutItem(slot).amt=std::min((uint32_t)"Player.Item Loadout Limit"_I,GetLoadoutItem(slot).Amt()); //We are only allowed to have up to 10 maximum of an item on a journey. GetLoadoutItem(slot).amt=std::min((uint32_t)"Player.Item Loadout Limit"_I,GetLoadoutItem(slot).Amt()); //We are only allowed to have up to 10 maximum of an item on a journey.
InputGroup*inputGroup=nullptr;
switch(slot){
case 0:{
inputGroup=&Player::KEY_ITEM1;
}break;
case 1:{
inputGroup=&Player::KEY_ITEM2;
}break;
case 2:{
inputGroup=&Player::KEY_ITEM3;
}break;
}
Ability itemAbility{itemName,"","","Item.Item Cooldown Time"_F,0,inputGroup,"items/"+itemName,VERY_DARK_RED,DARK_RED,PrecastData{GetLoadoutItem(slot).CastTime(),0,0},true};
switch(slot){
case 0:{
itemAbility.action=[&](Player*p,vf2d pos={}){
game->UseLoadoutItem(0);
return true;
};
game->GetPlayer()->SetItem1UseFunc(itemAbility);
}break;
case 1:{
itemAbility.action=[&](Player*p,vf2d pos={}){
game->UseLoadoutItem(1);
return true;
};
game->GetPlayer()->SetItem2UseFunc(itemAbility);
}break;
case 2:{
itemAbility.action=[&](Player*p,vf2d pos={}){
game->UseLoadoutItem(2);
return true;
};
game->GetPlayer()->SetItem3UseFunc(itemAbility);
}break;
}
}else{ }else{
ERR("Trying to set item "+itemName+" in Loadout slot "+std::to_string(slot)+" when said item does not exist in our inventory!"); ERR("Trying to set item "+itemName+" in Loadout slot "+std::to_string(slot)+" when said item does not exist in our inventory!");
} }
@ -2050,6 +2092,7 @@ void Crawler::UseLoadoutItem(int slot){
GetLoadoutItem(slot).OnUseAction(); GetLoadoutItem(slot).OnUseAction();
GetLoadoutItem(slot).amt--; GetLoadoutItem(slot).amt--;
} }
olc_UpdateKeyState(K1,false);
} }
void Crawler::ClearLoadoutItem(int slot){ void Crawler::ClearLoadoutItem(int slot){

@ -68,6 +68,8 @@ void ItemInfo::InitializeItems(){
img.Load(imgPath); img.Load(imgPath);
std::string scriptName="",description="",category=""; std::string scriptName="",description="",category="";
float castTime=0;
float cooldownTime="Item.Item Cooldown Time"_F;
for(auto&itemKey:DATA["ItemDatabase"][key.first].GetKeys()){ for(auto&itemKey:DATA["ItemDatabase"][key.first].GetKeys()){
std::string keyName=itemKey.first; std::string keyName=itemKey.first;
if(keyName=="Description"){ if(keyName=="Description"){
@ -78,6 +80,12 @@ void ItemInfo::InitializeItems(){
}else }else
if(keyName=="ItemScript"){ if(keyName=="ItemScript"){
scriptName=DATA["ItemDatabase"][key.first][keyName].GetString(); scriptName=DATA["ItemDatabase"][key.first][keyName].GetString();
}else
if(keyName=="Cast Time"){
castTime=DATA["ItemDatabase"][key.first][keyName].GetReal();
}else
if(keyName=="Cooldown Time"){
castTime=DATA["ItemDatabase"][key.first][keyName].GetReal();
}else{ //THis is a custom override modifier for a script. NO-OP }else{ //THis is a custom override modifier for a script. NO-OP
} }
} }
@ -92,6 +100,8 @@ void ItemInfo::InitializeItems(){
it.name=key.first; it.name=key.first;
it.description=description; it.description=description;
it.category=category; it.category=category;
it.castTime=castTime;
it.cooldownTime=cooldownTime;
if(!ITEM_CATEGORIES.count(it.category)){ if(!ITEM_CATEGORIES.count(it.category)){
ERR("WARNING! Tried to add item "<<it.name<<" to category "<<it.category<<" which does not exist!") ERR("WARNING! Tried to add item "<<it.name<<" to category "<<it.category<<" which does not exist!")
} }
@ -204,10 +214,15 @@ bool Inventory::RemoveItem(IT it,ITCategory inventory,uint32_t amt){
} }
#pragma endregion #pragma endregion
uint32_t itemAmt=GetItemCount(it);
if(inventory=="Monster Loot"||inventory=="Stage Loot"){
itemAmt=inv.at(count).Amt();
}
//There are two places to manipulate items in (Both the sorted inventory and the actual inventory) //There are two places to manipulate items in (Both the sorted inventory and the actual inventory)
if (!inv.at(count).Amt())return false; if (!itemAmt)return false;
if (amt>=inv.at(count).Amt()){ if (amt>=itemAmt){
inv.erase(inv.begin()+count); inv.erase(inv.begin()+count);
if(!eraseFromLootWindow){ if(!eraseFromLootWindow){
_inventory.erase(it); _inventory.erase(it);
@ -361,3 +376,19 @@ void ItemOverlay::Draw(){
void ItemOverlay::AddToItemOverlay(const ItemInfo&it){ void ItemOverlay::AddToItemOverlay(const ItemInfo&it){
items.push_back(ItemOverlay{it}); items.push_back(ItemOverlay{it});
} }
float ItemInfo::CastTime(){
return castTime;
}
float ItemInfo::CooldownTime(){
return cooldownTime;
}
float Item::CastTime(){
return it->CastTime();
}
float Item::CooldownTime(){
return it->CooldownTime();
}

@ -51,6 +51,7 @@ class Item{
friend class Inventory; friend class Inventory;
friend class Crawler; friend class Crawler;
private: private:
//The amount in the current item stack.
uint32_t amt; uint32_t amt;
ItemInfo*it; ItemInfo*it;
public: public:
@ -62,6 +63,8 @@ public:
ITCategory Category(); ITCategory Category();
Decal*Decal(); Decal*Decal();
ItemScript&OnUseAction(); ItemScript&OnUseAction();
float CastTime();
float CooldownTime();
bool IsBlank(); bool IsBlank();
static Item BLANK; static Item BLANK;
bool operator==(const Item&rhs)const; bool operator==(const Item&rhs)const;
@ -69,8 +72,10 @@ public:
class Inventory{ class Inventory{
friend class ItemInfo; friend class ItemInfo;
friend class Item;
public: public:
static void AddItem(IT it,uint32_t amt=1,bool monsterDrop=false); static void AddItem(IT it,uint32_t amt=1,bool monsterDrop=false);
//Returns the actual amount available in your main inventory.
static uint32_t GetItemCount(IT it); static uint32_t GetItemCount(IT it);
static Item GetItem(IT it); static Item GetItem(IT it);
//Auto-executes its use function and removes the amt specified from the inventory. Multiple amounts will cause the item to execute its useFunc multiple times. //Auto-executes its use function and removes the amt specified from the inventory. Multiple amounts will cause the item to execute its useFunc multiple times.
@ -91,6 +96,7 @@ private:
static void InsertIntoStageInventoryCategory(IT item,uint32_t amt,bool monsterDrop); static void InsertIntoStageInventoryCategory(IT item,uint32_t amt,bool monsterDrop);
static bool ExecuteAction(IT item); static bool ExecuteAction(IT item);
static std::map<IT,Item>_inventory; static std::map<IT,Item>_inventory;
//Only contains "1" of every item, as this is a map to index items and not the actual storage of items!
static std::map<ITCategory,std::vector<Item>>sortedInv; static std::map<ITCategory,std::vector<Item>>sortedInv;
}; };
@ -110,6 +116,8 @@ class ItemInfo{
std::string name; std::string name;
std::string description; std::string description;
std::string category; std::string category;
float castTime=0;
float cooldownTime=0;
Decal*img; Decal*img;
//Returns true if the item can be used, false otherwise //Returns true if the item can be used, false otherwise
std::string useFunc=""; std::string useFunc="";
@ -126,10 +134,12 @@ public:
std::string Description(); std::string Description();
ITCategory Category(); ITCategory Category();
Decal*Decal(); Decal*Decal();
ItemScript&OnUseAction();
/* /*
For the useFunc, return true if the item can be used, false otherwise. For the useFunc, return true if the item can be used, false otherwise.
*/ */
ItemScript&OnUseAction();
float CastTime();
float CooldownTime();
}; };
class ItemOverlay{ class ItemOverlay{

@ -60,6 +60,9 @@ InputGroup Player::KEY_ABILITY2;
InputGroup Player::KEY_ABILITY3; InputGroup Player::KEY_ABILITY3;
InputGroup Player::KEY_ABILITY4; InputGroup Player::KEY_ABILITY4;
InputGroup Player::KEY_DEFENSIVE; InputGroup Player::KEY_DEFENSIVE;
InputGroup Player::KEY_ITEM1;
InputGroup Player::KEY_ITEM2;
InputGroup Player::KEY_ITEM3;
Player::Player() Player::Player()
:lastReleasedMovementKey(DOWN),facingDirection(DOWN),state(State::NORMAL){ :lastReleasedMovementKey(DOWN),facingDirection(DOWN),state(State::NORMAL){
@ -217,7 +220,10 @@ void Player::Update(float fElapsedTime){
&ability=GetAbility1(), &ability=GetAbility1(),
&ability2=GetAbility2(), &ability2=GetAbility2(),
&ability3=GetAbility3(), &ability3=GetAbility3(),
&ability4=GetAbility4(); &ability4=GetAbility4(),
&item1=useItem1,
&item2=useItem2,
&item3=useItem3;
attack_cooldown_timer=std::max(0.f,attack_cooldown_timer-fElapsedTime); attack_cooldown_timer=std::max(0.f,attack_cooldown_timer-fElapsedTime);
iframe_time=std::max(0.f,iframe_time-fElapsedTime); iframe_time=std::max(0.f,iframe_time-fElapsedTime);
notEnoughManaDisplay.second=std::max(0.f,notEnoughManaDisplay.second-fElapsedTime); notEnoughManaDisplay.second=std::max(0.f,notEnoughManaDisplay.second-fElapsedTime);
@ -336,6 +342,9 @@ void Player::Update(float fElapsedTime){
ability2.cooldown-=fElapsedTime; ability2.cooldown-=fElapsedTime;
ability3.cooldown-=fElapsedTime; ability3.cooldown-=fElapsedTime;
ability4.cooldown-=fElapsedTime; ability4.cooldown-=fElapsedTime;
item1.cooldown-=fElapsedTime;
item2.cooldown-=fElapsedTime;
item3.cooldown-=fElapsedTime;
if(rightClickAbility.cooldown<0){ if(rightClickAbility.cooldown<0){
rightClickAbility.cooldown=0; rightClickAbility.cooldown=0;
} }
@ -351,6 +360,15 @@ void Player::Update(float fElapsedTime){
if(ability4.cooldown<0){ if(ability4.cooldown<0){
ability4.cooldown=0; ability4.cooldown=0;
} }
if(item1.cooldown<0){
item1.cooldown=0;
}
if(item2.cooldown<0){
item2.cooldown=0;
}
if(item3.cooldown<0){
item3.cooldown=0;
}
for(Monster&m:MONSTER_LIST){ for(Monster&m:MONSTER_LIST){
if(!HasIframes()&&abs(m.GetZ()-GetZ())<=1&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){ if(!HasIframes()&&abs(m.GetZ()-GetZ())<=1&&OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(m.GetPos(),12*m.GetSizeMult()/2))){
if(m.IsAlive()){ if(m.IsAlive()){
@ -417,11 +435,14 @@ void Player::Update(float fElapsedTime){
} }
} }
}; };
CheckAndPerformAbility(GetAbility1(),Player::KEY_ABILITY1); CheckAndPerformAbility(rightClickAbility,Player::KEY_DEFENSIVE);
CheckAndPerformAbility(GetAbility2(),Player::KEY_ABILITY2); CheckAndPerformAbility(ability,Player::KEY_ABILITY1);
CheckAndPerformAbility(GetAbility3(),Player::KEY_ABILITY3); CheckAndPerformAbility(ability2,Player::KEY_ABILITY2);
CheckAndPerformAbility(GetAbility4(),Player::KEY_ABILITY4); CheckAndPerformAbility(ability3,Player::KEY_ABILITY3);
CheckAndPerformAbility(GetRightClickAbility(),Player::KEY_DEFENSIVE); CheckAndPerformAbility(ability4,Player::KEY_ABILITY4);
CheckAndPerformAbility(item1,Player::KEY_ITEM1);
CheckAndPerformAbility(item2,Player::KEY_ITEM2);
CheckAndPerformAbility(item3,Player::KEY_ITEM3);
if(GetState()==State::PREP_CAST){ if(GetState()==State::PREP_CAST){
#define CheckAbilityKeyReleasedAndCastSpell(ability,releaseState) \ #define CheckAbilityKeyReleasedAndCastSpell(ability,releaseState) \
@ -436,8 +457,13 @@ void Player::Update(float fElapsedTime){
CheckAbilityKeyReleasedAndCastSpell(ability3,Player::KEY_ABILITY3.Released()) CheckAbilityKeyReleasedAndCastSpell(ability3,Player::KEY_ABILITY3.Released())
else else
CheckAbilityKeyReleasedAndCastSpell(ability4,Player::KEY_ABILITY4.Released()) CheckAbilityKeyReleasedAndCastSpell(ability4,Player::KEY_ABILITY4.Released())
else
CheckAbilityKeyReleasedAndCastSpell(item1,Player::KEY_ITEM1.Released())
else
CheckAbilityKeyReleasedAndCastSpell(item2,Player::KEY_ITEM2.Released())
else
CheckAbilityKeyReleasedAndCastSpell(item3,Player::KEY_ITEM3.Released())
} }
} }
#pragma region Warrior #pragma region Warrior
@ -788,3 +814,14 @@ void Player::CheckEndZoneCollision(){
} }
endZoneStandTime=0; endZoneStandTime=0;
} }
void Player::SetItem1UseFunc(Ability a){
useItem1=a;
};
void Player::SetItem2UseFunc(Ability a){
useItem2=a;
};
void Player::SetItem3UseFunc(Ability a){
useItem3=a;
};

@ -94,6 +94,9 @@ private:
void Initialize(); void Initialize();
float iframe_time=0; float iframe_time=0;
float lastCombatTime=0; float lastCombatTime=0;
Ability useItem1;
Ability useItem2;
Ability useItem3;
protected: protected:
const float ATTACK_COOLDOWN="Warrior.Auto Attack.Cooldown"_F; const float ATTACK_COOLDOWN="Warrior.Auto Attack.Cooldown"_F;
const float MAGIC_ATTACK_COOLDOWN="Wizard.Auto Attack.Cooldown"_F; const float MAGIC_ATTACK_COOLDOWN="Wizard.Auto Attack.Cooldown"_F;
@ -222,7 +225,11 @@ public:
CastInfo&GetCastInfo(); CastInfo&GetCastInfo();
void SetAnimationBasedOnTargetingDirection(float targetDirection); void SetAnimationBasedOnTargetingDirection(float targetDirection);
static InputGroup KEY_ABILITY1, KEY_ABILITY2, KEY_ABILITY3, KEY_ABILITY4, KEY_DEFENSIVE; void SetItem1UseFunc(Ability a);
void SetItem2UseFunc(Ability a);
void SetItem3UseFunc(Ability a);
static InputGroup KEY_ABILITY1, KEY_ABILITY2, KEY_ABILITY3, KEY_ABILITY4, KEY_DEFENSIVE, KEY_ITEM1, KEY_ITEM2, KEY_ITEM3;
}; };
struct Warrior:Player{ struct Warrior:Player{
@ -409,7 +416,7 @@ struct Witch:Player{
#class".Right Click Ability.Cooldown"_F, \ #class".Right Click Ability.Cooldown"_F, \
#class".Right Click Ability.Mana Cost"_I, \ #class".Right Click Ability.Mana Cost"_I, \
&KEY_DEFENSIVE, \ &KEY_DEFENSIVE, \
#class".Right Click Ability.Icon"_S, \ "Ability Icons/"+#class".Right Click Ability.Icon"_S, \
{uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[3]==0?255:#class".Right Click Ability.Cooldown Bar Color 1"_f[3])}, \ {uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 1"_f[3]==0?255:#class".Right Click Ability.Cooldown Bar Color 1"_f[3])}, \
{uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[3]==0?255:#class".Right Click Ability.Cooldown Bar Color 2"_f[3])}, \ {uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Right Click Ability.Cooldown Bar Color 2"_f[3]==0?255:#class".Right Click Ability.Cooldown Bar Color 2"_f[3])}, \
{#class".Right Click Ability.Precast Time"_F,#class".Right Click Ability.Casting Range"_I/100.f*24,#class".Right Click Ability.Casting Size"_I/100.f*24}, \ {#class".Right Click Ability.Precast Time"_F,#class".Right Click Ability.Casting Range"_I/100.f*24,#class".Right Click Ability.Casting Size"_I/100.f*24}, \
@ -422,7 +429,7 @@ struct Witch:Player{
#class".Ability 1.Cooldown"_F, \ #class".Ability 1.Cooldown"_F, \
#class".Ability 1.Mana Cost"_I, \ #class".Ability 1.Mana Cost"_I, \
&KEY_ABILITY1, \ &KEY_ABILITY1, \
#class".Ability 1.Icon"_S, \ "Ability Icons/"+#class".Ability 1.Icon"_S, \
{uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[3]==0?255:#class".Ability 1.Cooldown Bar Color 1"_f[3])}, \ {uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Ability 1.Cooldown Bar Color 1"_f[3]==0?255:#class".Ability 1.Cooldown Bar Color 1"_f[3])}, \
{uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[3]==0?255:#class".Ability 1.Cooldown Bar Color 2"_f[3])}, \ {uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Ability 1.Cooldown Bar Color 2"_f[3]==0?255:#class".Ability 1.Cooldown Bar Color 2"_f[3])}, \
{#class".Ability 1.Precast Time"_F,#class".Ability 1.Casting Range"_I/100.f*24,#class".Ability 1.Casting Size"_I/100.f*24}, \ {#class".Ability 1.Precast Time"_F,#class".Ability 1.Casting Range"_I/100.f*24,#class".Ability 1.Casting Size"_I/100.f*24}, \
@ -435,7 +442,7 @@ struct Witch:Player{
#class".Ability 2.Cooldown"_F, \ #class".Ability 2.Cooldown"_F, \
#class".Ability 2.Mana Cost"_I, \ #class".Ability 2.Mana Cost"_I, \
&KEY_ABILITY2, \ &KEY_ABILITY2, \
#class".Ability 2.Icon"_S, \ "Ability Icons/"+#class".Ability 2.Icon"_S, \
{uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[3]==0?255:#class".Ability 2.Cooldown Bar Color 1"_f[3])}, \ {uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Ability 2.Cooldown Bar Color 1"_f[3]==0?255:#class".Ability 2.Cooldown Bar Color 1"_f[3])}, \
{uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[3]==0?255:#class".Ability 2.Cooldown Bar Color 2"_f[3])}, \ {uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Ability 2.Cooldown Bar Color 2"_f[3]==0?255:#class".Ability 2.Cooldown Bar Color 2"_f[3])}, \
{#class".Ability 2.Precast Time"_F,#class".Ability 2.Casting Range"_I/100.f*24,#class".Ability 2.Casting Size"_I/100.f*24}, \ {#class".Ability 2.Precast Time"_F,#class".Ability 2.Casting Range"_I/100.f*24,#class".Ability 2.Casting Size"_I/100.f*24}, \
@ -448,7 +455,7 @@ struct Witch:Player{
#class".Ability 3.Cooldown"_F, \ #class".Ability 3.Cooldown"_F, \
#class".Ability 3.Mana Cost"_I, \ #class".Ability 3.Mana Cost"_I, \
&KEY_ABILITY3, \ &KEY_ABILITY3, \
#class".Ability 3.Icon"_S, \ "Ability Icons/"+#class".Ability 3.Icon"_S, \
{uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[3]==0?255:#class".Ability 3.Cooldown Bar Color 1"_f[3])}, \ {uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[0]),uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[1]),uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[2]),uint8_t(#class".Ability 3.Cooldown Bar Color 1"_f[3]==0?255:#class".Ability 3.Cooldown Bar Color 1"_f[3])}, \
{uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[3]==0?255:#class".Ability 3.Cooldown Bar Color 2"_f[3])}, \ {uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[0]),uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[1]),uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[2]),uint8_t(#class".Ability 3.Cooldown Bar Color 2"_f[3]==0?255:#class".Ability 3.Cooldown Bar Color 2"_f[3])}, \
{#class".Ability 3.Precast Time"_F,#class".Ability 3.Casting Range"_I/100.f*24,#class".Ability 3.Casting Size"_I/100.f*24}, \ {#class".Ability 3.Precast Time"_F,#class".Ability 3.Casting Range"_I/100.f*24,#class".Ability 3.Casting Size"_I/100.f*24}, \

@ -35,7 +35,7 @@ SUCH DAMAGE.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 1 #define VERSION_PATCH 1
#define VERSION_BUILD 3096 #define VERSION_BUILD 3109
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="9" nextobjectid="142"> <map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="9" nextobjectid="143">
<properties> <properties>
<property name="Level Type" propertytype="LevelType" value="Dungeon"/> <property name="Level Type" propertytype="LevelType" value="Dungeon"/>
</properties> </properties>
@ -1969,6 +1969,6 @@
</properties> </properties>
<point/> <point/>
</object> </object>
<object id="141" name="Player Spawn" type="PlayerSpawnLocation" x="600" y="4272" width="24" height="24"/> <object id="142" name="Player Spawn" type="PlayerSpawnLocation" x="4800" y="2232" width="24" height="24"/>
</objectgroup> </objectgroup>
</map> </map>

@ -55,7 +55,7 @@ debug_access_options = 0
debug_map_load_info = 0 debug_map_load_info = 0
# Shows extra info about the player on the HUD # Shows extra info about the player on the HUD
debug_player_info = 0 debug_player_info = 1
# Shows collision boxes of tiles. # Shows collision boxes of tiles.
debug_collision_boxes = 0 debug_collision_boxes = 0

@ -6,6 +6,8 @@ ItemDatabase
Description = Restores 40 health points. Description = Restores 40 health points.
HP Restore = 40 HP Restore = 40
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Medium Health Potion Medium Health Potion
{ {
@ -13,6 +15,8 @@ ItemDatabase
Description = Restores 100 health points. Description = Restores 100 health points.
HP Restore = 100 HP Restore = 100
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Large Health Potion Large Health Potion
{ {
@ -20,6 +24,8 @@ ItemDatabase
Description = Restores 320 health points. Description = Restores 320 health points.
HP Restore = 320 HP Restore = 320
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Small Mana Potion Small Mana Potion
{ {
@ -27,6 +33,8 @@ ItemDatabase
Description = Restores 40 mana points. Description = Restores 40 mana points.
MP Restore = 40 MP Restore = 40
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Medium Mana Potion Medium Mana Potion
{ {
@ -34,6 +42,8 @@ ItemDatabase
Description = Restores 100 mana points. Description = Restores 100 mana points.
MP Restore = 100 MP Restore = 100
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Large Mana Potion Large Mana Potion
{ {
@ -41,112 +51,156 @@ ItemDatabase
Description = Restores 320 mana points. Description = Restores 320 mana points.
MP Restore = 320 MP Restore = 320
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 1 Dummy Item 1
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 2 Dummy Item 2
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 3 Dummy Item 3
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 4 Dummy Item 4
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 5 Dummy Item 5
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 6 Dummy Item 6
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 7 Dummy Item 7
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 8 Dummy Item 8
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 9 Dummy Item 9
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 10 Dummy Item 10
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 11 Dummy Item 11
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 12 Dummy Item 12
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 13 Dummy Item 13
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 14 Dummy Item 14
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 15 Dummy Item 15
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 16 Dummy Item 16
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 17 Dummy Item 17
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 18 Dummy Item 18
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 19 Dummy Item 19
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Dummy Item 20 Dummy Item 20
{ {
Description = Does nothing apparently. Description = Does nothing apparently.
ItemCategory = Consumables ItemCategory = Consumables
Cooldown Time = 2.5
Cast Time = 0.0
} }
Bandages Bandages
{ {
ItemScript = Restore ItemScript = Restore
Description = Restores 10% health points. Description = Restores 10% health points.
HP % Restore = 10% HP % Restore = 10%
Cast Time = 1.0
Cooldown Time = 2.5
ItemCategory = Consumables ItemCategory = Consumables
} }
Green Slime Remains Green Slime Remains

@ -4,6 +4,11 @@ ItemConfiguration
Item Scripts = "ItemScript.txt" Item Scripts = "ItemScript.txt"
Item Categories = "ItemCategory.txt Item Categories = "ItemCategory.txt
} }
Item
{
# Amount of time to wait before an item can be used again (Global).
Item Cooldown Time = 2.5
}
ItemDrop ItemDrop
{ {
# Item drops horizontal random speed range # Item drops horizontal random speed range

Loading…
Cancel
Save