Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/__DEFINES/~doppler_defines/TESHARI_WAR_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Factions
#define WAR_FACTION_TIZIRA "Tizira"
#define WAR_FACTION_TESHARI "Teshari"
#define WAR_FACTION_NEUTRAL "Neutral"
1 change: 1 addition & 0 deletions code/modules/cargo/exports/large_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/obj/structure/closet/crate/large,
/obj/structure/closet/crate/mail,
/obj/structure/closet/crate/wooden,
/obj/structure/closet/crate/donation, // DOPPLER EDIT ADDITION - Dono crates are in loadout and are craftable... do not want infinite money glitch
)

/datum/export/large/crate/total_printout(datum/export_report/ex, notes = TRUE) // That's why a goddamn metal crate costs that much.
Expand Down
1 change: 1 addition & 0 deletions code/modules/cargo/orderconsole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
packs += list(list(
"name" = pack.name,
"cost" = pack.get_cost() * get_discount(),
"shortagemult" = pack.get_shortage_price_mult(), // DOPPLER EDIT ADDITION - TESHARI_WAR STORY MODULE
"id" = pack_id,
"desc" = pack.desc || pack.name, // If there is a description, use it. Otherwise use the pack's name.
"first_item_icon" = first_item?.icon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,18 @@ GLOBAL_VAR(department_cd_override)
if(!islist(supply_data[pack.group]) || !can_see_pack(pack))
continue

// DOPPLER EDIT ADDITION BEGIN - TESHARI_WAR STORY MODULE
var/shortage_text = ""
if (pack.is_unavailable())
shortage_text = " (Shortages: Unavailable!)"
else if (pack.get_shortage_price_mult() != 1)
shortage_text = " (Shortages: [pack.get_shortage_price_mult()]x cooldown)"
// DOPPLER EDIT ADDITION END
UNTYPED_LIST_ADD(supply_data[pack.group], list(
"name" = pack.name,
"cost" = pack.get_cost(),
"unavailable" = pack.is_unavailable(), // DOPPLER EDIT ADDITION - TESHARI_WAR STORY MODULE
"shortage_text" = shortage_text, // DOPPLER EDIT ADDITION - TESHARI_WAR STORY MODULE
"id" = pack.id,
"desc" = pack.desc || pack.name, // If there is a description, use it. Otherwise use the pack's name.
))
Expand Down
1 change: 1 addition & 0 deletions config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$include game_options.txt
$include dbconfig.txt
$include doppler/config_doppler.txt
$include doppler/STORY_SUPPLY_SHORTAGE.txt
$include comms.txt
$include logging.txt
$include resources.txt
Expand Down
10 changes: 10 additions & 0 deletions config/doppler/STORY_SUPPLY_SHORTAGE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Instructions - write SUPPLY_SHORTAGES, followed by this format: SUPPLYPACKTYPEPATH,MULT to change the price of
## a supply pack.
## 1 has no effect.
## -1 will make the item completely unavailable.
## Mults below 1, including 0, are possible, but highly inadvisable.

## Examples:
#SUPPLY_SHORTAGES /datum/supply_pack/goody/laser_single,1.5
#SUPPLY_SHORTAGES /datum/supply_pack/security/armory/laser,-1
#SUPPLY_SHORTAGES /datum/supply_pack/security/stingpack,4
11 changes: 11 additions & 0 deletions modular_doppler/STORY_teshari_war/config.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/datum/config_entry/keyed_list/supply_shortages
key_mode = KEY_MODE_TYPE
value_mode = VALUE_MODE_NUM
splitter = ","

/datum/config_entry/keyed_list/supply_shortages/validate_config_key(key)
var/type = text2path(key)
if (type in get_usable_supply_packs())
return key
log_config("ERROR: [key] is not a valid supply pack typepath.")
return null
3 changes: 3 additions & 0 deletions modular_doppler/STORY_teshari_war/mind.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/datum/mind
/// The stance this mind takes on the tizira/teshari war. By default, they dont care at all.
var/war_faction = WAR_FACTION_NEUTRAL // i just wanna grill
30 changes: 30 additions & 0 deletions modular_doppler/STORY_teshari_war/preferences.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
GLOBAL_LIST_INIT(teshari_war_factions, list(
WAR_FACTION_TIZIRA,
WAR_FACTION_TESHARI,
WAR_FACTION_NEUTRAL
))

/datum/preference/choiced/doppler_war_faction
savefile_key = "doppler_war_faction"
main_feature_name = "War Alignment"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
priority = PREFERENCE_PRIORITY_DEFAULT

/datum/preference/choiced/doppler_war_faction/init_possible_values()
return GLOB.teshari_war_factions

/datum/preference/choiced/doppler_war_faction/create_default_value()
return WAR_FACTION_NEUTRAL

/datum/preference/choiced/doppler_war_faction/apply_to_human(mob/living/carbon/human/target, value)
RegisterSignal(target, COMSIG_MOB_MIND_INITIALIZED, PROC_REF(apply_mind_variable), override = TRUE)
return

/// Signal handler that waits for mind to init and then sets the war faction variable.
/datum/preference/choiced/doppler_war_faction/proc/apply_mind_variable(mob/living/carbon/human/target, datum/mind/new_mind)
SIGNAL_HANDLER

new_mind.war_faction = target.client.prefs.read_preference(/datum/preference/choiced/doppler_war_faction)
UnregisterSignal(target, COMSIG_MOB_MIND_INITIALIZED)

35 changes: 35 additions & 0 deletions modular_doppler/STORY_teshari_war/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Title: Teshari/Tizira war

MODULE ID: TESHARI_WAR

### Description:

TEMPORARY STORY MODULE. WILL BE REVERTED WHEN THE ARC ENDS.

### TG Proc Changes:

code/modules/cargo/orderconsole.dm - L192, added "shortagemult" = pack.get_shortage_price_mult(),
code/modules/modular_computers/file_system/programs/dept_order.dm - L88 - L99

tgui/packages/tgui/interfaces/NtosDeptOrder.tsx - L31-L32, L211-213, L223
tgui/packages/tgui/interfaces/Cargo/CargoCatalog.tsx - L201-L204, L221-L223, L241-L245
tgui/packages/tgui/interfaces/Cargo/types.ts - L42

config/config.txt - L6

### Defines:

code\_\_DEFINES\~doppler_defines\TESHARI_WAR_defines.dm

### Master file additions

N/A

### Included files that are not contained in this module:

config/doppler/STORY_SUPPLY_SHORTAGE.txt
tgui\packages\tgui\interfaces\PreferencesMenu\preferences\features\dopplershift_preferences\war_faction.tsx

### Credits:

Niko
32 changes: 32 additions & 0 deletions modular_doppler/STORY_teshari_war/supply_pack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/// Returns a list of non-abstract supply packs.
/proc/get_usable_supply_packs()
RETURN_TYPE(/list)
var/list/packs = list()
for (var/datum/supply_pack/iter_path as anything in subtypesof(/datum/supply_pack))
if (iter_path::abstract_type == iter_path)
continue
packs += iter_path
return packs

/// Returns the assoc list of stringified supply pack typepaths to their price mult.
/proc/get_price_mults()
RETURN_TYPE(/list)
return CONFIG_GET(keyed_list/supply_shortages)

// If this proc returns -1, the item is wholly unavailable.
/// Returns the actual price mult of the supply pack. If -1, the item is completely unavailable. Use get_cost() for actual price calculations.
/datum/supply_pack/proc/get_shortage_price_mult()
var/mult = get_price_mults()["[type]"]
if (isnull(mult))
return 1
return mult

/// Returns TRUE if our shortage price mult is -1.
/datum/supply_pack/proc/is_unavailable()
return get_shortage_price_mult() == -1

/datum/supply_pack/get_cost()
. = ..()

if (!is_unavailable())
. *= get_shortage_price_mult()
17 changes: 17 additions & 0 deletions modular_doppler/STORY_teshari_war/war_posters/code/cargo.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/datum/supply_pack/goody/tesh_posters
name = "Teshari Propaganda"
desc = "A box of teshari war posters."
cost = CARGO_CRATE_VALUE * 1.1
contains = list(/obj/item/storage/box/doppler_war_posters/teshari)

/datum/supply_pack/goody/tizira_posters
name = "Tiziran Propaganda"
desc = "A box of tiziran war posters."
cost = CARGO_CRATE_VALUE * 1.1
contains = list(/obj/item/storage/box/doppler_war_posters/tiziran)

/datum/supply_pack/goody/iso_posters
name = "Isolationist Posters"
desc = "A box of isolationist war posters."
cost = CARGO_CRATE_VALUE * 1.1
contains = list(/obj/item/storage/box/doppler_war_posters/isolationist)
11 changes: 11 additions & 0 deletions modular_doppler/STORY_teshari_war/war_posters/code/loadout.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/datum/loadout_item/pocket_items/equipment/propaganda_box_teshari
name = "Teshari propaganda box"
item_path = /obj/item/storage/box/doppler_war_posters/teshari

/datum/loadout_item/pocket_items/equipment/propaganda_box_tiziran
name = "Tiziran propaganda box"
item_path = /obj/item/storage/box/doppler_war_posters/tiziran

/datum/loadout_item/pocket_items/equipment/propaganda_box_isolationist
name = "Isolationist propaganda box"
item_path = /obj/item/storage/box/doppler_war_posters/isolationist
15 changes: 15 additions & 0 deletions modular_doppler/STORY_teshari_war/war_posters/code/mood.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#define WAR_POSTER_MOOD_CAT "poster_mood"

/datum/mood_event/war_poster_sympathy
description = "I saw a poster that reinforces my beliefs. It's good to have like-minded people around."
mood_change = 2
category = WAR_POSTER_MOOD_CAT
timeout = 120 SECONDS

/datum/mood_event/war_poster_wrong
description = "I saw a poster that really pissed me off! How can people like that be allowed to work here?!"
mood_change = -4
category = WAR_POSTER_MOOD_CAT
timeout = 120 SECONDS

#undef WAR_POSTER_MOOD_CAT
Loading