Backpack clothing type added.
This commit is contained in:
@@ -9,7 +9,8 @@ void run_clothing_menu() {
|
|||||||
"Skin Pants (6 Skins, 3 Vines)",
|
"Skin Pants (6 Skins, 3 Vines)",
|
||||||
"Skin Tunic (4 Skins, 2 Vines)",
|
"Skin Tunic (4 Skins, 2 Vines)",
|
||||||
"Moccasins (2 Skins, 1 Vine)",
|
"Moccasins (2 Skins, 1 Vine)",
|
||||||
"Skin Pouch (2 Skins, 1 Vine)"
|
"Skin Pouch (2 Skins, 1 Vine)",
|
||||||
|
"Backpack (11 Skins, 5 Vines, 4 Skin Pouches)"
|
||||||
};
|
};
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
@@ -39,6 +40,7 @@ void run_clothing_menu() {
|
|||||||
else if (selection == 3) craft_skin_tunic();
|
else if (selection == 3) craft_skin_tunic();
|
||||||
else if (selection == 4) craft_moccasins();
|
else if (selection == 4) craft_moccasins();
|
||||||
else if (selection == 5) craft_skin_pouch();
|
else if (selection == 5) craft_skin_pouch();
|
||||||
|
else if (selection == 6) craft_backpack();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +51,7 @@ void run_clothing_menu() {
|
|||||||
else if (selection == 3) craft_skin_tunic_max();
|
else if (selection == 3) craft_skin_tunic_max();
|
||||||
else if (selection == 4) craft_moccasins_max();
|
else if (selection == 4) craft_moccasins_max();
|
||||||
else if (selection == 5) craft_skin_pouch_max();
|
else if (selection == 5) craft_skin_pouch_max();
|
||||||
|
else if (selection == 6) craft_backpack_max();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,3 +360,59 @@ void craft_skin_pouch_max() {
|
|||||||
inv_skin_pouches += max_craft;
|
inv_skin_pouches += max_craft;
|
||||||
speak_with_history("Crafted " + max_craft + " Skin Pouches.", true);
|
speak_with_history("Crafted " + max_craft + " Skin Pouches.", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void craft_backpack() {
|
||||||
|
string missing = "";
|
||||||
|
if (inv_skins < 11) missing += "11 skins ";
|
||||||
|
if (inv_vines < 5) missing += "5 vines ";
|
||||||
|
if (inv_skin_pouches < 4) missing += "4 skin pouches ";
|
||||||
|
|
||||||
|
if (missing == "") {
|
||||||
|
if (inv_backpacks >= get_personal_stack_limit()) {
|
||||||
|
speak_with_history("You can't carry any more backpacks.", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
simulate_crafting(20);
|
||||||
|
inv_skins -= 11;
|
||||||
|
inv_vines -= 5;
|
||||||
|
inv_skin_pouches -= 4;
|
||||||
|
inv_backpacks++;
|
||||||
|
speak_with_history("Crafted a Backpack.", true);
|
||||||
|
} else {
|
||||||
|
speak_with_history("Missing: " + missing, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void craft_backpack_max() {
|
||||||
|
if (inv_backpacks >= get_personal_stack_limit()) {
|
||||||
|
speak_with_history("You can't carry any more backpacks.", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int max_by_skins = inv_skins / 11;
|
||||||
|
int max_by_vines = inv_vines / 5;
|
||||||
|
int max_by_pouches = inv_skin_pouches / 4;
|
||||||
|
int max_craft = max_by_skins;
|
||||||
|
if (max_by_vines < max_craft) max_craft = max_by_vines;
|
||||||
|
if (max_by_pouches < max_craft) max_craft = max_by_pouches;
|
||||||
|
|
||||||
|
int space = get_personal_stack_limit() - inv_backpacks;
|
||||||
|
if (max_craft > space) max_craft = space;
|
||||||
|
|
||||||
|
if (max_craft <= 0) {
|
||||||
|
string missing = "";
|
||||||
|
if (inv_skins < 11) missing += "11 skins ";
|
||||||
|
if (inv_vines < 5) missing += "5 vines ";
|
||||||
|
if (inv_skin_pouches < 4) missing += "4 skin pouches ";
|
||||||
|
speak_with_history("Missing: " + missing, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int total_cost = max_craft * 20; // 11 skins + 5 vines + 4 pouches per backpack
|
||||||
|
simulate_crafting(total_cost);
|
||||||
|
inv_skins -= (max_craft * 11);
|
||||||
|
inv_vines -= (max_craft * 5);
|
||||||
|
inv_skin_pouches -= (max_craft * 4);
|
||||||
|
inv_backpacks += max_craft;
|
||||||
|
speak_with_history("Crafted " + max_craft + " Backpacks.", true);
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ int inv_skin_pants = 0;
|
|||||||
int inv_skin_tunics = 0;
|
int inv_skin_tunics = 0;
|
||||||
int inv_moccasins = 0;
|
int inv_moccasins = 0;
|
||||||
int inv_skin_pouches = 0;
|
int inv_skin_pouches = 0;
|
||||||
|
int inv_backpacks = 0;
|
||||||
|
|
||||||
int storage_stones = 0;
|
int storage_stones = 0;
|
||||||
int storage_sticks = 0;
|
int storage_sticks = 0;
|
||||||
@@ -71,6 +72,7 @@ int storage_skin_pants = 0;
|
|||||||
int storage_skin_tunics = 0;
|
int storage_skin_tunics = 0;
|
||||||
int storage_moccasins = 0;
|
int storage_moccasins = 0;
|
||||||
int storage_skin_pouches = 0;
|
int storage_skin_pouches = 0;
|
||||||
|
int storage_backpacks = 0;
|
||||||
|
|
||||||
bool spear_equipped = false;
|
bool spear_equipped = false;
|
||||||
bool axe_equipped = false;
|
bool axe_equipped = false;
|
||||||
@@ -88,6 +90,7 @@ const int EQUIP_PANTS = 5;
|
|||||||
const int EQUIP_TUNIC = 6;
|
const int EQUIP_TUNIC = 6;
|
||||||
const int EQUIP_MOCCASINS = 7;
|
const int EQUIP_MOCCASINS = 7;
|
||||||
const int EQUIP_POUCH = 8;
|
const int EQUIP_POUCH = 8;
|
||||||
|
const int EQUIP_BACKPACK = 10;
|
||||||
const int ITEM_STICKS = 0;
|
const int ITEM_STICKS = 0;
|
||||||
const int ITEM_VINES = 1;
|
const int ITEM_VINES = 1;
|
||||||
const int ITEM_REEDS = 2;
|
const int ITEM_REEDS = 2;
|
||||||
@@ -121,6 +124,7 @@ const int ITEM_QUIVERS = 29;
|
|||||||
const int ITEM_BOWSTRINGS = 30;
|
const int ITEM_BOWSTRINGS = 30;
|
||||||
const int ITEM_SINEW = 31;
|
const int ITEM_SINEW = 31;
|
||||||
const int ITEM_BOAR_CARCASSES = 32;
|
const int ITEM_BOAR_CARCASSES = 32;
|
||||||
|
const int ITEM_BACKPACKS = 33;
|
||||||
const int HAT_MAX_HEALTH_BONUS = 1;
|
const int HAT_MAX_HEALTH_BONUS = 1;
|
||||||
const int GLOVES_MAX_HEALTH_BONUS = 1;
|
const int GLOVES_MAX_HEALTH_BONUS = 1;
|
||||||
const int PANTS_MAX_HEALTH_BONUS = 3;
|
const int PANTS_MAX_HEALTH_BONUS = 3;
|
||||||
@@ -144,6 +148,8 @@ int get_personal_stack_limit() {
|
|||||||
int limit = MAX_ITEM_STACK;
|
int limit = MAX_ITEM_STACK;
|
||||||
if (equipped_arms == EQUIP_POUCH) {
|
if (equipped_arms == EQUIP_POUCH) {
|
||||||
limit += POUCH_STACK_BONUS;
|
limit += POUCH_STACK_BONUS;
|
||||||
|
} else if (equipped_arms == EQUIP_BACKPACK) {
|
||||||
|
limit += 9;
|
||||||
}
|
}
|
||||||
return limit;
|
return limit;
|
||||||
}
|
}
|
||||||
@@ -166,6 +172,7 @@ string get_equipment_name(int equip_type) {
|
|||||||
if (equip_type == EQUIP_TUNIC) return "Skin Tunic";
|
if (equip_type == EQUIP_TUNIC) return "Skin Tunic";
|
||||||
if (equip_type == EQUIP_MOCCASINS) return "Moccasins";
|
if (equip_type == EQUIP_MOCCASINS) return "Moccasins";
|
||||||
if (equip_type == EQUIP_POUCH) return "Skin Pouch";
|
if (equip_type == EQUIP_POUCH) return "Skin Pouch";
|
||||||
|
if (equip_type == EQUIP_BACKPACK) return "Backpack";
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,6 +187,7 @@ bool equipment_available(int equip_type) {
|
|||||||
if (equip_type == EQUIP_TUNIC) return inv_skin_tunics > 0;
|
if (equip_type == EQUIP_TUNIC) return inv_skin_tunics > 0;
|
||||||
if (equip_type == EQUIP_MOCCASINS) return inv_moccasins > 0;
|
if (equip_type == EQUIP_MOCCASINS) return inv_moccasins > 0;
|
||||||
if (equip_type == EQUIP_POUCH) return inv_skin_pouches > 0;
|
if (equip_type == EQUIP_POUCH) return inv_skin_pouches > 0;
|
||||||
|
if (equip_type == EQUIP_BACKPACK) return inv_backpacks > 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,6 +206,7 @@ void equip_equipment_type(int equip_type) {
|
|||||||
else if (equip_type == EQUIP_PANTS) equipped_legs = EQUIP_PANTS;
|
else if (equip_type == EQUIP_PANTS) equipped_legs = EQUIP_PANTS;
|
||||||
else if (equip_type == EQUIP_MOCCASINS) equipped_feet = EQUIP_MOCCASINS;
|
else if (equip_type == EQUIP_MOCCASINS) equipped_feet = EQUIP_MOCCASINS;
|
||||||
else if (equip_type == EQUIP_POUCH) equipped_arms = EQUIP_POUCH;
|
else if (equip_type == EQUIP_POUCH) equipped_arms = EQUIP_POUCH;
|
||||||
|
else if (equip_type == EQUIP_BACKPACK) equipped_arms = EQUIP_BACKPACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool equipment_is_equipped(int equip_type) {
|
bool equipment_is_equipped(int equip_type) {
|
||||||
@@ -211,6 +220,7 @@ bool equipment_is_equipped(int equip_type) {
|
|||||||
if (equip_type == EQUIP_PANTS) return equipped_legs == EQUIP_PANTS;
|
if (equip_type == EQUIP_PANTS) return equipped_legs == EQUIP_PANTS;
|
||||||
if (equip_type == EQUIP_MOCCASINS) return equipped_feet == EQUIP_MOCCASINS;
|
if (equip_type == EQUIP_MOCCASINS) return equipped_feet == EQUIP_MOCCASINS;
|
||||||
if (equip_type == EQUIP_POUCH) return equipped_arms == EQUIP_POUCH;
|
if (equip_type == EQUIP_POUCH) return equipped_arms == EQUIP_POUCH;
|
||||||
|
if (equip_type == EQUIP_BACKPACK) return equipped_arms == EQUIP_BACKPACK;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,6 +245,8 @@ void unequip_equipment_type(int equip_type) {
|
|||||||
equipped_feet = EQUIP_NONE;
|
equipped_feet = EQUIP_NONE;
|
||||||
} else if (equip_type == EQUIP_POUCH && equipped_arms == EQUIP_POUCH) {
|
} else if (equip_type == EQUIP_POUCH && equipped_arms == EQUIP_POUCH) {
|
||||||
equipped_arms = EQUIP_NONE;
|
equipped_arms = EQUIP_NONE;
|
||||||
|
} else if (equip_type == EQUIP_BACKPACK && equipped_arms == EQUIP_BACKPACK) {
|
||||||
|
equipped_arms = EQUIP_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,6 +352,7 @@ int get_personal_count(int item_type) {
|
|||||||
if (item_type == ITEM_SKIN_TUNICS) return inv_skin_tunics;
|
if (item_type == ITEM_SKIN_TUNICS) return inv_skin_tunics;
|
||||||
if (item_type == ITEM_MOCCASINS) return inv_moccasins;
|
if (item_type == ITEM_MOCCASINS) return inv_moccasins;
|
||||||
if (item_type == ITEM_SKIN_POUCHES) return inv_skin_pouches;
|
if (item_type == ITEM_SKIN_POUCHES) return inv_skin_pouches;
|
||||||
|
if (item_type == ITEM_BACKPACKS) return inv_backpacks;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,6 +390,7 @@ int get_storage_count(int item_type) {
|
|||||||
if (item_type == ITEM_SKIN_TUNICS) return storage_skin_tunics;
|
if (item_type == ITEM_SKIN_TUNICS) return storage_skin_tunics;
|
||||||
if (item_type == ITEM_MOCCASINS) return storage_moccasins;
|
if (item_type == ITEM_MOCCASINS) return storage_moccasins;
|
||||||
if (item_type == ITEM_SKIN_POUCHES) return storage_skin_pouches;
|
if (item_type == ITEM_SKIN_POUCHES) return storage_skin_pouches;
|
||||||
|
if (item_type == ITEM_BACKPACKS) return storage_backpacks;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,6 +428,7 @@ string get_item_label(int item_type) {
|
|||||||
if (item_type == ITEM_SKIN_TUNICS) return "skin tunics";
|
if (item_type == ITEM_SKIN_TUNICS) return "skin tunics";
|
||||||
if (item_type == ITEM_MOCCASINS) return "moccasins";
|
if (item_type == ITEM_MOCCASINS) return "moccasins";
|
||||||
if (item_type == ITEM_SKIN_POUCHES) return "skin pouches";
|
if (item_type == ITEM_SKIN_POUCHES) return "skin pouches";
|
||||||
|
if (item_type == ITEM_BACKPACKS) return "backpacks";
|
||||||
return "items";
|
return "items";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,6 +471,7 @@ string get_item_label_singular(int item_type) {
|
|||||||
if (item_type == ITEM_SKIN_TUNICS) return "skin tunic";
|
if (item_type == ITEM_SKIN_TUNICS) return "skin tunic";
|
||||||
if (item_type == ITEM_MOCCASINS) return "moccasin";
|
if (item_type == ITEM_MOCCASINS) return "moccasin";
|
||||||
if (item_type == ITEM_SKIN_POUCHES) return "skin pouch";
|
if (item_type == ITEM_SKIN_POUCHES) return "skin pouch";
|
||||||
|
if (item_type == ITEM_BACKPACKS) return "backpack";
|
||||||
return "item";
|
return "item";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,6 +509,7 @@ double get_item_favor_value(int item_type) {
|
|||||||
if (item_type == ITEM_SKIN_TUNICS) return 1.20;
|
if (item_type == ITEM_SKIN_TUNICS) return 1.20;
|
||||||
if (item_type == ITEM_MOCCASINS) return 0.80;
|
if (item_type == ITEM_MOCCASINS) return 0.80;
|
||||||
if (item_type == ITEM_SKIN_POUCHES) return 0.80;
|
if (item_type == ITEM_SKIN_POUCHES) return 0.80;
|
||||||
|
if (item_type == ITEM_BACKPACKS) return 2.50;
|
||||||
return 0.01;
|
return 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,6 +537,7 @@ void cleanup_equipment_after_inventory_change() {
|
|||||||
if (inv_skin_pants <= 0) equipped_legs = EQUIP_NONE;
|
if (inv_skin_pants <= 0) equipped_legs = EQUIP_NONE;
|
||||||
if (inv_skin_tunics <= 0) equipped_torso = EQUIP_NONE;
|
if (inv_skin_tunics <= 0) equipped_torso = EQUIP_NONE;
|
||||||
if (inv_moccasins <= 0) equipped_feet = EQUIP_NONE;
|
if (inv_moccasins <= 0) equipped_feet = EQUIP_NONE;
|
||||||
if (inv_skin_pouches <= 0) equipped_arms = EQUIP_NONE;
|
if (inv_skin_pouches <= 0 && equipped_arms == EQUIP_POUCH) equipped_arms = EQUIP_NONE;
|
||||||
|
if (inv_backpacks <= 0 && equipped_arms == EQUIP_BACKPACK) equipped_arms = EQUIP_NONE;
|
||||||
update_max_health_from_equipment();
|
update_max_health_from_equipment();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ void show_character_info() {
|
|||||||
if (equipped_torso == EQUIP_TUNIC) equipped_clothing.insert_last("Skin Tunic");
|
if (equipped_torso == EQUIP_TUNIC) equipped_clothing.insert_last("Skin Tunic");
|
||||||
else missing_slots.insert_last("torso");
|
else missing_slots.insert_last("torso");
|
||||||
if (equipped_arms == EQUIP_POUCH) equipped_clothing.insert_last("Skin Pouch");
|
if (equipped_arms == EQUIP_POUCH) equipped_clothing.insert_last("Skin Pouch");
|
||||||
|
else if (equipped_arms == EQUIP_BACKPACK) equipped_clothing.insert_last("Backpack");
|
||||||
else missing_slots.insert_last("arms");
|
else missing_slots.insert_last("arms");
|
||||||
if (equipped_hands == EQUIP_GLOVES) equipped_clothing.insert_last("Skin Gloves");
|
if (equipped_hands == EQUIP_GLOVES) equipped_clothing.insert_last("Skin Gloves");
|
||||||
else missing_slots.insert_last("hands");
|
else missing_slots.insert_last("hands");
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ void check_equipment_menu() {
|
|||||||
// Check if player has any equipment
|
// Check if player has any equipment
|
||||||
if (inv_spears == 0 && inv_axes == 0 && inv_slings == 0 &&
|
if (inv_spears == 0 && inv_axes == 0 && inv_slings == 0 &&
|
||||||
inv_skin_hats == 0 && inv_skin_gloves == 0 && inv_skin_pants == 0 &&
|
inv_skin_hats == 0 && inv_skin_gloves == 0 && inv_skin_pants == 0 &&
|
||||||
inv_skin_tunics == 0 && inv_moccasins == 0 && inv_skin_pouches == 0) {
|
inv_skin_tunics == 0 && inv_moccasins == 0 && inv_skin_pouches == 0 &&
|
||||||
|
inv_backpacks == 0) {
|
||||||
speak_with_history("Nothing to equip.", true);
|
speak_with_history("Nothing to equip.", true);
|
||||||
} else {
|
} else {
|
||||||
run_equipment_menu();
|
run_equipment_menu();
|
||||||
@@ -67,6 +68,11 @@ void run_equipment_menu() {
|
|||||||
options.insert_last("Skin Pouch" + status);
|
options.insert_last("Skin Pouch" + status);
|
||||||
equipment_types.insert_last(EQUIP_POUCH);
|
equipment_types.insert_last(EQUIP_POUCH);
|
||||||
}
|
}
|
||||||
|
if (inv_backpacks > 0) {
|
||||||
|
string status = equipment_is_equipped(EQUIP_BACKPACK) ? " (equipped)" : "";
|
||||||
|
options.insert_last("Backpack" + status);
|
||||||
|
equipment_types.insert_last(EQUIP_BACKPACK);
|
||||||
|
}
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
wait(5);
|
wait(5);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ void build_personal_inventory_options(string[]@ options, int[]@ item_types) {
|
|||||||
options.insert_last("Skin Tunics: " + inv_skin_tunics); item_types.insert_last(ITEM_SKIN_TUNICS);
|
options.insert_last("Skin Tunics: " + inv_skin_tunics); item_types.insert_last(ITEM_SKIN_TUNICS);
|
||||||
options.insert_last("Moccasins: " + inv_moccasins); item_types.insert_last(ITEM_MOCCASINS);
|
options.insert_last("Moccasins: " + inv_moccasins); item_types.insert_last(ITEM_MOCCASINS);
|
||||||
options.insert_last("Skin Pouches: " + inv_skin_pouches); item_types.insert_last(ITEM_SKIN_POUCHES);
|
options.insert_last("Skin Pouches: " + inv_skin_pouches); item_types.insert_last(ITEM_SKIN_POUCHES);
|
||||||
|
options.insert_last("Backpacks: " + inv_backpacks); item_types.insert_last(ITEM_BACKPACKS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_inventory() {
|
void show_inventory() {
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ void deposit_item(int item_type) {
|
|||||||
else if (item_type == ITEM_SKIN_TUNICS) { inv_skin_tunics -= amount; storage_skin_tunics += amount; }
|
else if (item_type == ITEM_SKIN_TUNICS) { inv_skin_tunics -= amount; storage_skin_tunics += amount; }
|
||||||
else if (item_type == ITEM_MOCCASINS) { inv_moccasins -= amount; storage_moccasins += amount; }
|
else if (item_type == ITEM_MOCCASINS) { inv_moccasins -= amount; storage_moccasins += amount; }
|
||||||
else if (item_type == ITEM_SKIN_POUCHES) { inv_skin_pouches -= amount; storage_skin_pouches += amount; }
|
else if (item_type == ITEM_SKIN_POUCHES) { inv_skin_pouches -= amount; storage_skin_pouches += amount; }
|
||||||
|
else if (item_type == ITEM_BACKPACKS) { inv_backpacks -= amount; storage_backpacks += amount; }
|
||||||
|
|
||||||
cleanup_equipment_after_inventory_change();
|
cleanup_equipment_after_inventory_change();
|
||||||
speak_with_history("Deposited " + amount + " " + get_item_label(item_type) + ".", true);
|
speak_with_history("Deposited " + amount + " " + get_item_label(item_type) + ".", true);
|
||||||
@@ -120,6 +121,7 @@ void deposit_item_max(int item_type) {
|
|||||||
else if (item_type == ITEM_SKIN_TUNICS) { inv_skin_tunics -= amount; storage_skin_tunics += amount; }
|
else if (item_type == ITEM_SKIN_TUNICS) { inv_skin_tunics -= amount; storage_skin_tunics += amount; }
|
||||||
else if (item_type == ITEM_MOCCASINS) { inv_moccasins -= amount; storage_moccasins += amount; }
|
else if (item_type == ITEM_MOCCASINS) { inv_moccasins -= amount; storage_moccasins += amount; }
|
||||||
else if (item_type == ITEM_SKIN_POUCHES) { inv_skin_pouches -= amount; storage_skin_pouches += amount; }
|
else if (item_type == ITEM_SKIN_POUCHES) { inv_skin_pouches -= amount; storage_skin_pouches += amount; }
|
||||||
|
else if (item_type == ITEM_BACKPACKS) { inv_backpacks -= amount; storage_backpacks += amount; }
|
||||||
|
|
||||||
cleanup_equipment_after_inventory_change();
|
cleanup_equipment_after_inventory_change();
|
||||||
speak_with_history("Deposited " + amount + " " + get_item_label(item_type) + ".", true);
|
speak_with_history("Deposited " + amount + " " + get_item_label(item_type) + ".", true);
|
||||||
@@ -167,6 +169,7 @@ void withdraw_item(int item_type) {
|
|||||||
else if (item_type == ITEM_SKIN_TUNICS) { storage_skin_tunics -= amount; inv_skin_tunics += amount; }
|
else if (item_type == ITEM_SKIN_TUNICS) { storage_skin_tunics -= amount; inv_skin_tunics += amount; }
|
||||||
else if (item_type == ITEM_MOCCASINS) { storage_moccasins -= amount; inv_moccasins += amount; }
|
else if (item_type == ITEM_MOCCASINS) { storage_moccasins -= amount; inv_moccasins += amount; }
|
||||||
else if (item_type == ITEM_SKIN_POUCHES) { storage_skin_pouches -= amount; inv_skin_pouches += amount; }
|
else if (item_type == ITEM_SKIN_POUCHES) { storage_skin_pouches -= amount; inv_skin_pouches += amount; }
|
||||||
|
else if (item_type == ITEM_BACKPACKS) { storage_backpacks -= amount; inv_backpacks += amount; }
|
||||||
|
|
||||||
speak_with_history("Withdrew " + amount + " " + get_item_label(item_type) + ".", true);
|
speak_with_history("Withdrew " + amount + " " + get_item_label(item_type) + ".", true);
|
||||||
}
|
}
|
||||||
@@ -216,6 +219,7 @@ void withdraw_item_max(int item_type) {
|
|||||||
else if (item_type == ITEM_SKIN_TUNICS) { storage_skin_tunics -= amount; inv_skin_tunics += amount; }
|
else if (item_type == ITEM_SKIN_TUNICS) { storage_skin_tunics -= amount; inv_skin_tunics += amount; }
|
||||||
else if (item_type == ITEM_MOCCASINS) { storage_moccasins -= amount; inv_moccasins += amount; }
|
else if (item_type == ITEM_MOCCASINS) { storage_moccasins -= amount; inv_moccasins += amount; }
|
||||||
else if (item_type == ITEM_SKIN_POUCHES) { storage_skin_pouches -= amount; inv_skin_pouches += amount; }
|
else if (item_type == ITEM_SKIN_POUCHES) { storage_skin_pouches -= amount; inv_skin_pouches += amount; }
|
||||||
|
else if (item_type == ITEM_BACKPACKS) { storage_backpacks -= amount; inv_backpacks += amount; }
|
||||||
|
|
||||||
speak_with_history("Withdrew " + amount + " " + get_item_label(item_type) + ".", true);
|
speak_with_history("Withdrew " + amount + " " + get_item_label(item_type) + ".", true);
|
||||||
}
|
}
|
||||||
@@ -250,6 +254,7 @@ void build_storage_inventory_options(string[]@ options, int[]@ item_types) {
|
|||||||
options.insert_last("Skin Tunics: " + storage_skin_tunics); item_types.insert_last(ITEM_SKIN_TUNICS);
|
options.insert_last("Skin Tunics: " + storage_skin_tunics); item_types.insert_last(ITEM_SKIN_TUNICS);
|
||||||
options.insert_last("Moccasins: " + storage_moccasins); item_types.insert_last(ITEM_MOCCASINS);
|
options.insert_last("Moccasins: " + storage_moccasins); item_types.insert_last(ITEM_MOCCASINS);
|
||||||
options.insert_last("Skin Pouches: " + storage_skin_pouches); item_types.insert_last(ITEM_SKIN_POUCHES);
|
options.insert_last("Skin Pouches: " + storage_skin_pouches); item_types.insert_last(ITEM_SKIN_POUCHES);
|
||||||
|
options.insert_last("Backpacks: " + storage_backpacks); item_types.insert_last(ITEM_BACKPACKS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_storage_menu() {
|
void run_storage_menu() {
|
||||||
|
|||||||
@@ -502,8 +502,9 @@ bool load_game_state_from_raw(const string&in rawData) {
|
|||||||
if (get_raw_number(rawData, "equipment_feet", value)) equipped_feet = value;
|
if (get_raw_number(rawData, "equipment_feet", value)) equipped_feet = value;
|
||||||
if (get_raw_number(rawData, "equipment_arms", value)) equipped_arms = value;
|
if (get_raw_number(rawData, "equipment_arms", value)) equipped_arms = value;
|
||||||
|
|
||||||
if (equipped_arms != EQUIP_POUCH) equipped_arms = EQUIP_NONE;
|
if (equipped_arms != EQUIP_POUCH && equipped_arms != EQUIP_BACKPACK) equipped_arms = EQUIP_NONE;
|
||||||
if (equipped_arms == EQUIP_POUCH && inv_skin_pouches <= 0) equipped_arms = EQUIP_NONE;
|
if (equipped_arms == EQUIP_POUCH && inv_skin_pouches <= 0) equipped_arms = EQUIP_NONE;
|
||||||
|
if (equipped_arms == EQUIP_BACKPACK && inv_backpacks <= 0) equipped_arms = EQUIP_NONE;
|
||||||
if (incense_hours_remaining > 0) incense_burning = true;
|
if (incense_hours_remaining > 0) incense_burning = true;
|
||||||
|
|
||||||
if (inv_small_game_types.length() == 0 && inv_small_game > 0) {
|
if (inv_small_game_types.length() == 0 && inv_small_game > 0) {
|
||||||
@@ -895,15 +896,16 @@ bool load_game_state() {
|
|||||||
if (equipped_hands != EQUIP_GLOVES) equipped_hands = EQUIP_NONE;
|
if (equipped_hands != EQUIP_GLOVES) equipped_hands = EQUIP_NONE;
|
||||||
if (equipped_legs != EQUIP_PANTS) equipped_legs = EQUIP_NONE;
|
if (equipped_legs != EQUIP_PANTS) equipped_legs = EQUIP_NONE;
|
||||||
if (equipped_feet != EQUIP_MOCCASINS) equipped_feet = EQUIP_NONE;
|
if (equipped_feet != EQUIP_MOCCASINS) equipped_feet = EQUIP_NONE;
|
||||||
if (equipped_arms != EQUIP_POUCH) equipped_arms = EQUIP_NONE;
|
if (equipped_arms != EQUIP_POUCH && equipped_arms != EQUIP_BACKPACK) equipped_arms = EQUIP_NONE;
|
||||||
if (equipped_arms == EQUIP_POUCH && inv_skin_pouches <= 0) equipped_arms = EQUIP_NONE;
|
if (equipped_arms == EQUIP_POUCH && inv_skin_pouches <= 0) equipped_arms = EQUIP_NONE;
|
||||||
|
if (equipped_arms == EQUIP_BACKPACK && inv_backpacks <= 0) equipped_arms = EQUIP_NONE;
|
||||||
reset_quick_slots();
|
reset_quick_slots();
|
||||||
string[] loadedQuickSlots = get_string_list_or_split(saveData, "equipment_quick_slots");
|
string[] loadedQuickSlots = get_string_list_or_split(saveData, "equipment_quick_slots");
|
||||||
uint slot_count = loadedQuickSlots.length();
|
uint slot_count = loadedQuickSlots.length();
|
||||||
if (slot_count > quick_slots.length()) slot_count = quick_slots.length();
|
if (slot_count > quick_slots.length()) slot_count = quick_slots.length();
|
||||||
for (uint i = 0; i < slot_count; i++) {
|
for (uint i = 0; i < slot_count; i++) {
|
||||||
int slot_value = parse_int(loadedQuickSlots[i]);
|
int slot_value = parse_int(loadedQuickSlots[i]);
|
||||||
if (slot_value >= EQUIP_NONE && slot_value <= EQUIP_POUCH) {
|
if (slot_value >= EQUIP_NONE && slot_value <= EQUIP_BACKPACK) {
|
||||||
quick_slots[i] = slot_value;
|
quick_slots[i] = slot_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user