Skip to content

Commit

Permalink
add mounted bow crate into archer shop (request by arsenpip)
Browse files Browse the repository at this point in the history
  • Loading branch information
TerminalHash committed Sep 24, 2024
1 parent b89f016 commit e526229
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Base/Entities/Common/Includes/Costs.as
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace CTFCosts
quarry_stone, quarry_gold, quarry_count;

//ArcherShop.as
s32 arrows, waterarrows, firearrows, bombarrows, blockarrows, stoneblockarrows;
s32 arrows, waterarrows, firearrows, bombarrows, blockarrows, stoneblockarrows, mountedbow;

//KnightShop.as
s32 bomb, waterbomb, mine, keg, satchel, stickybomb, golden_mine, icebomb;
Expand Down Expand Up @@ -126,6 +126,7 @@ void InitCosts()
CTFCosts::bombarrows = ReadCost(cfg, costs, "cost_bombarrows" , 50);
CTFCosts::blockarrows = ReadCost(cfg, costs, "cost_blockarrows" , 40);
CTFCosts::stoneblockarrows = ReadCost(cfg, costs, "cost_stoneblockarrows" , 70);
CTFCosts::mountedbow = ReadCost(cfg, costs, "cost_mountedbow" , 100);

//KnightShop.as
CTFCosts::bomb = ReadCost(cfg, costs, "cost_bomb" , 25);
Expand Down
11 changes: 10 additions & 1 deletion Base/Entities/Industry/CTFShops/ArcherShop/ArcherShop.as
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "CheckSpam.as"
#include "Costs.as"
#include "GenericButtonCommon.as"
#include "TeamIconToken.as"
#include "TranslationsSystem.as"

void onInit(CBlob@ this)
Expand All @@ -24,10 +25,12 @@ void onInit(CBlob@ this)

// SHOP
this.set_Vec2f("shop offset", Vec2f_zero);
this.set_Vec2f("shop menu size", Vec2f(6, 1));
this.set_Vec2f("shop menu size", Vec2f(7, 1));
this.set_string("shop description", "Buy");
this.set_u8("shop icon", 25);

int team_num = this.getTeamNum();

// CLASS
this.set_Vec2f("class offset", Vec2f(-6, 0));
this.set_string("required class", "archer");
Expand Down Expand Up @@ -90,6 +93,12 @@ void onInit(CBlob@ this)
ShopItem@ s = addShopItem(this, Names::stonearrow, "$stoneblockarrows$", "mat_stoneblockarrows", Descriptions::stonearrowdesc, true);
AddRequirement(s.requirements, "coin", "", "Coins", CTFCosts::stoneblockarrows);
}
{
string mountedbow_icon = getTeamIcon("mounted_bow", "MountedBow.png", team_num, Vec2f(16, 16), 6);
ShopItem@ s = addShopItem(this, "Mounted Bow", mountedbow_icon, "mounted_bow", Descriptions::mountedbowdesc, false, true);
s.crate_icon = 3;
AddRequirement(s.requirements, "coin", "", "Coins", CTFCosts::mountedbow);
}
}

void GetButtonsFor(CBlob@ this, CBlob@ caller)
Expand Down
1 change: 1 addition & 0 deletions Base/Entities/Industry/CTFShops/CTFCosts.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
cost_bombarrows = 65 # Prevent "Archer-Rocketman" meta
cost_blockarrows = 40
cost_stoneblockarrows = 70
cost_mountedbow = 100

#builder shop
cost_lantern_wood = 10
Expand Down
4 changes: 3 additions & 1 deletion Modules/BindingsModule/BindingsCommon.as
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ string[][] button_texts =
Names::firearrowsnmb,
Names::bombarrowsnmb,
Names::blockarrowsnmb,
Names::stoneblockarrowsnmb
Names::stoneblockarrowsnmb,
Names::mountedbownmb
},
{ // BUILDER SHOP
Names::drillbnmb,
Expand Down Expand Up @@ -198,6 +199,7 @@ string[][] button_file_names =
"a_bombarrows",
"a_blockarrows",
"a_stoneblockarrows",
"a_mountedbow"
},
{
"b_drill",
Expand Down
2 changes: 2 additions & 0 deletions Modules/BindingsModule/BindingsSystem.as
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ void onInit(CRules@ this)
if (!file.exists("a_blockarrows$2")) file.add_s32("a_blockarrows$2", -1);
if (!file.exists("a_stoneblockarrows$1")) file.add_s32("a_stoneblockarrows$1", 54);
if (!file.exists("a_stoneblockarrows$2")) file.add_s32("a_stoneblockarrows$2", -1);
if (!file.exists("a_mountedbow$1")) file.add_s32("a_mountedbow$1", 55);
if (!file.exists("a_mountedbow$2")) file.add_s32("a_mountedbow$2", -1);

// kfc
if (!file.exists("kfc_beer$1")) file.add_s32("kfc_beer$1", 49);
Expand Down
7 changes: 6 additions & 1 deletion Modules/BindingsModule/NoMenuBuying.as
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ void onTick(CBlob@ this)
wanna_buy = true;
item_id = 5;
}
if (b_KeyJustPressed("a_mountedbow")) {
wanna_buy = true;
item_id = 6;
}

if (wanna_buy) {
dont_show_emotes = true;
Expand Down Expand Up @@ -490,7 +494,8 @@ void onRender(CSprite@ this)
"a_firearrows",
"a_bombarrows",
"a_blockarrows",
"a_stoneblockarrows"
"a_stoneblockarrows",
"a_mountedbow"
};

if (thearchershop.get("shop array", @shopitems)) {
Expand Down
2 changes: 2 additions & 0 deletions Translations/TranslationsSystem.as
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace Descriptions
// ArcherShop.as
woodenarrowdesc = Translate(en::d_woodenarrowdesc+"\\"+ru::d_woodenarrowdesc),
stonearrowdesc = Translate(en::d_stonearrowdesc+"\\"+ru::d_stonearrowdesc),
mountedbowdesc = Translate(en::d_mountedbowdesc+"\\"+ru::d_mountedbowdesc),

// BindingsCommon.as
modbindplaceholder = Translate(en::d_modbindplaceholder+"\\"+ru::d_modbindplaceholder),
Expand Down Expand Up @@ -194,6 +195,7 @@ namespace Names
bombarrowsnmb = Translate(en::n_bombarrowsnmb+"\\"+ru::n_bombarrowsnmb),
blockarrowsnmb = Translate(en::n_blockarrowsnmb+"\\"+ru::n_blockarrowsnmb),
stoneblockarrowsnmb = Translate(en::n_stoneblockarrowsnmb+"\\"+ru::n_stoneblockarrowsnmb),
mountedbownmb = Translate(en::n_mountedbownmb+"\\"+ru::n_mountedbownmb),

// Quarters
beernmb = Translate(en::n_beernmb+"\\"+ru::n_beernmb),
Expand Down
2 changes: 2 additions & 0 deletions Translations/language_en.as
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace en
// ArcherShop.as
d_woodenarrowdesc = "Spawns wooden block at the landing site.",
d_stonearrowdesc = "Spawns stone block at the landing site.",
d_mountedbowdesc = "Stationary crossbow for those who want to be an archer for a while.",

// BindingsCommon.as
d_modbindplaceholder = "placeholder",
Expand Down Expand Up @@ -177,6 +178,7 @@ namespace en
n_bombarrowsnmb = "Bomb Arrows",
n_blockarrowsnmb = "Wooden Block Arrows",
n_stoneblockarrowsnmb = "Stone Block Arrows",
n_mountedbownmb = "Mounted Bow",

// Quarters
n_beernmb = "Kvass",
Expand Down
2 changes: 2 additions & 0 deletions Translations/language_ru.as
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace ru
// ArcherShop.as
d_woodenarrowdesc = "Ставит деревянный блок на месте приземления.",
d_stonearrowdesc = "Ставит каменный блок на месте приземления.",
d_mountedbowdesc = "Стационарный арбалет для тех, кто хочет хоть немного побыть лучником.",

// BindingsCommon.as
d_modbindplaceholder = "пусто",
Expand Down Expand Up @@ -177,6 +178,7 @@ namespace ru
n_bombarrowsnmb = "Стрелы-бомбы",
n_blockarrowsnmb = "Стрелы-блоки (дерево)",
n_stoneblockarrowsnmb = "Стрелы-блоки (камень)",
n_mountedbownmb = "Стационарный арбалет",

// Quarters
n_beernmb = "Квас",
Expand Down

0 comments on commit e526229

Please sign in to comment.