- same for inventory pickup messages.

This commit is contained in:
Christoph Oelckers 2019-12-09 19:00:30 +01:00
parent 670c8b1408
commit da1900dc8a
6 changed files with 48 additions and 39 deletions

View file

@ -967,11 +967,13 @@ enum
{
MAX_KEYS = 8,
MAX_FORTUNES = 16,
MAX_INVENTORY_Q = 11,//InvDecl_TOTAL
QUOTE_KEYMSG = 1,
QUOTE_DOORMSG = QUOTE_KEYMSG + MAX_KEYS,
// 23+24 are reserved.
QUOTE_COOKIE = 25,
QUOTE_INVENTORY = QUOTE_COOKIE + MAX_FORTUNES,
};
typedef struct

View file

@ -539,7 +539,6 @@ static int cm_transtok(const char *tok, const struct _tokset *set, const unsigne
// quit "PRESS (Y) TO QUIT, (N) TO FIGHT ON."
static LEVEL_INFO custommaps[MAX_LEVELS_REG];
static char *custominventoryname[InvDecl_TOTAL];
static char *customweaponname[2][MAX_WEAPONS]; // weapon, ammo
#define WM_DAMAGE 1
@ -879,9 +878,7 @@ void LoadCustomInfoFromScript(const char *filename)
if (name)
{
Bfree(custominventoryname[in]);
custominventoryname[in] = strdup(name);
InventoryDecls[in].name = custominventoryname[in];
quoteMgr.InitializeQuote(QUOTE_INVENTORY + in, name);
}
if (amt >= 0)
{

View file

@ -5544,17 +5544,17 @@ SWBOOL CanGetWeapon(PLAYERp pp, short SpriteNum, int WPN)
struct InventoryDecl_t InventoryDecls[InvDecl_TOTAL] =
{
{ "Armor Vest +50", 50 },
{ "Kevlar Armor Vest +100", 100 },
{ "MedKit +20", 20 },
{ "Fortune Cookie +50 BOOST", 50 },
{ "Portable MedKit", 100 },
{ "Gas Bomb", 1 },
{ "Flash Bomb", 2 },
{ "Caltrops", 3 },
{ "Night Vision Goggles", 100 },
{ "Repair Kit", 100 },
{ "Smoke Bomb", 100 },
{50 },
{100 },
{20 },
{50 },
{100 },
{1 },
{2 },
{3 },
{100 },
{100 },
{100 },
};
#define ITEMFLASHAMT -8
@ -5690,14 +5690,14 @@ KeyMain:
if (u->spal == PALETTE_PLAYER3)
{
PlayerUpdateArmor(pp, 1000+InventoryDecls[InvDecl_Kevlar].amount);
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_Kevlar].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_Kevlar));
}
else
{
if (pp->Armor < InventoryDecls[InvDecl_Armor].amount)
{
PlayerUpdateArmor(pp, 1000+InventoryDecls[InvDecl_Armor].amount);
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_Armor].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_Armor));
}
else
break;
@ -5726,7 +5726,7 @@ KeyMain:
{
SWBOOL putbackmax=FALSE;
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_SmMedkit].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_SmMedkit));
if (pp->MaxHealth == 200)
{
@ -5756,7 +5756,7 @@ KeyMain:
pp->MaxHealth = 200;
if (pu->Health < 200)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_Booster].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_Booster));
PlayerUpdateHealth(pp, InventoryDecls[InvDecl_Booster].amount); // This is for health
// over 100%
// Say something witty
@ -5789,7 +5789,7 @@ KeyMain:
if (!pp->InventoryAmount[INVENTORY_MEDKIT] || pp->InventoryPercent[INVENTORY_MEDKIT] < InventoryDecls[InvDecl_Medkit].amount)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_Medkit].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_Medkit));
pp->InventoryPercent[INVENTORY_MEDKIT] = InventoryDecls[InvDecl_Medkit].amount;
pp->InventoryAmount[INVENTORY_MEDKIT] = 1;
PlayerUpdateInventory(pp, INVENTORY_MEDKIT);
@ -5812,7 +5812,7 @@ KeyMain:
if (pp->InventoryAmount[INVENTORY_CHEMBOMB] < InventoryDecls[InvDecl_ChemBomb].amount)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_ChemBomb].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_ChemBomb));
pp->InventoryPercent[INVENTORY_CHEMBOMB] = 0;
pp->InventoryAmount[INVENTORY_CHEMBOMB]++;
PlayerUpdateInventory(pp, INVENTORY_CHEMBOMB);
@ -5827,7 +5827,7 @@ KeyMain:
if (pp->InventoryAmount[INVENTORY_FLASHBOMB] < InventoryDecls[InvDecl_FlashBomb].amount)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_FlashBomb].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_FlashBomb));
pp->InventoryPercent[INVENTORY_FLASHBOMB] = 0;
pp->InventoryAmount[INVENTORY_FLASHBOMB]++;
PlayerUpdateInventory(pp, INVENTORY_FLASHBOMB);
@ -5842,7 +5842,7 @@ KeyMain:
if (pp->InventoryAmount[INVENTORY_CALTROPS] < InventoryDecls[InvDecl_Caltrops].amount)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_Caltrops].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_Caltrops));
pp->InventoryPercent[INVENTORY_CALTROPS] = 0;
pp->InventoryAmount[INVENTORY_CALTROPS]+=3;
if (pp->InventoryAmount[INVENTORY_CALTROPS] > InventoryDecls[InvDecl_Caltrops].amount)
@ -5858,7 +5858,7 @@ KeyMain:
case ICON_NIGHT_VISION:
if (!pp->InventoryAmount[INVENTORY_NIGHT_VISION] || pp->InventoryPercent[INVENTORY_NIGHT_VISION] < InventoryDecls[InvDecl_NightVision].amount)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_NightVision].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_NightVision));
pp->InventoryPercent[INVENTORY_NIGHT_VISION] = InventoryDecls[InvDecl_NightVision].amount;
pp->InventoryAmount[INVENTORY_NIGHT_VISION] = 1;
PlayerUpdateInventory(pp, INVENTORY_NIGHT_VISION);
@ -5871,7 +5871,7 @@ KeyMain:
case ICON_REPAIR_KIT:
if (!pp->InventoryAmount[INVENTORY_REPAIR_KIT] || pp->InventoryPercent[INVENTORY_REPAIR_KIT] < InventoryDecls[InvDecl_RepairKit].amount)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_RepairKit].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_RepairKit));
pp->InventoryPercent[INVENTORY_REPAIR_KIT] = InventoryDecls[InvDecl_RepairKit].amount;
pp->InventoryAmount[INVENTORY_REPAIR_KIT] = 1;
PlayerUpdateInventory(pp, INVENTORY_REPAIR_KIT);
@ -5902,7 +5902,7 @@ KeyMain:
case ICON_CLOAK:
if (!pp->InventoryAmount[INVENTORY_CLOAK] || pp->InventoryPercent[INVENTORY_CLOAK] < InventoryDecls[InvDecl_Cloak].amount)
{
PutStringInfo(Player+pnum, InventoryDecls[InvDecl_Cloak].name);
PutStringInfo(Player+pnum, quoteMgr.GetQuote(QUOTE_INVENTORY + InvDecl_Cloak));
pp->InventoryPercent[INVENTORY_CLOAK] = InventoryDecls[InvDecl_Cloak].amount;
pp->InventoryAmount[INVENTORY_CLOAK] = 1;
PlayerUpdateInventory(pp, INVENTORY_CLOAK);

View file

@ -77,7 +77,6 @@ enum
struct InventoryDecl_t
{
const char *name;
int amount;
};
extern struct InventoryDecl_t InventoryDecls[InvDecl_TOTAL];

View file

@ -1808,4 +1808,15 @@ Man who fart in church sit in own pew.,TXTS_COOKIE13,,,,,,,,,,,,,,,,,,,,,,
Man trapped in pantry has ass in jam.,TXTS_COOKIE14,,,,,,,,,,,,,,,,,,,,,,
Baseball wrong. Man with 4 balls cannot walk.,TXTS_COOKIE15,,,,,,,,,,,,,,,,,,,,,,
Man who buy drowned cat pay for wet pussy.,TXTS_COOKIE16,,,,,,,,,,,,,,,,,,,,,,
Fortune Say:,TXTS_FORTUNE,,,,,,,,,,,,,,,,,,,,,,
Fortune Say:,TXTS_FORTUNE,,,,,,,,,,,,,,,,,,,,,,
Armor Vest +50,TXTS_INV1,,,,,,,,,,,,,,,,,,,,,,
Kevlar Armor Vest +100,TXTS_INV2,,,,,,,,,,,,,,,,,,,,,,
MedKit +20,TXTS_INV3,,,,,,,,,,,,,,,,,,,,,,
Fortune Cookie +50 BOOST,TXTS_INV4,,,,,,,,,,,,,,,,,,,,,,
Portable MedKit,TXTS_INV5,,,,,,,,,,,,,,,,,,,,,,
Gas Bomb,TXTS_INV6,,,,,,,,,,,,,,,,,,,,,,
Flash Bomb,TXTS_INV7,,,,,,,,,,,,,,,,,,,,,,
Caltrops,TXTS_INV8,,,,,,,,,,,,,,,,,,,,,,
Night Vision Goggles,TXTS_INV9,,,,,,,,,,,,,,,,,,,,,,
Repair Kit,TXTS_INV10,,,,,,,,,,,,,,,,,,,,,,
Smoke Bomb,TXTS_INV11,,,,,,,,,,,,,,,,,,,,,,
1 default Identifier Remarks Filter eng enc ena enz eni ens enj enb enl ent enw cs de el eo es esm esn esg esc esa esd esv eso esr ess esf esl esy esz esb ese esh esi esu fi fr hu it jp ko nl pl pt ptg ro ru sr
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822

View file

@ -279,57 +279,57 @@ skill 4
/*
inventory 1
{
name "Armor Vest +50"
name "$TXT_INV1"
amount 50
}
inventory 2
{
name "Kevlar Armor Vest +100"
name "$TXT_INV2"
amount 100
}
inventory 3
{
name "MedKit +20"
name "$TXT_INV3"
amount 20
}
inventory 4
{
name "Fortune Cookie +50 BOOST"
name "$TXT_INV4"
amount 50
}
inventory 5
{
name "Portable MedKit"
name "$TXT_INV5"
amount 100
}
inventory 6
{
name "Gas Bomb"
name "$TXT_INV6"
amount 1
}
inventory 7
{
name "Flash Bomb"
name "$TXT_INV7"
amount 2
}
inventory 8
{
name "Caltrops"
name "$TXT_INV8"
amount 3
}
inventory 9
{
name "Night Vision Goggles"
name "$TXT_INV9"
amount 100
}
inventory 10
{
name "Repair Kit"
name "$TXT_INV10"
amount 100
}
inventory 11
{
name "Smoke Bomb"
name "$TXT_INV11"
amount 100
}
weapon 1