Skip to content

Commit

Permalink
Merge pull request #702 from Very-Soft/mapswap
Browse files Browse the repository at this point in the history
Map Swap
  • Loading branch information
Very-Soft authored Dec 8, 2024
2 parents 054ad7b + c1795bd commit 92e6ec1
Show file tree
Hide file tree
Showing 11 changed files with 636 additions and 32 deletions.
5 changes: 5 additions & 0 deletions ATTRIBUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,8 @@
**Link:** https://github.com/CHOMPStation2/CHOMPStation2/pull/262<br>
**License:** [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)<br>
<br>
**File**: `icons/obj/aliencoins.dmi`<br>
**Creator:** VerySoft<br>
**Link:** https://github.com/VOREStation/VOREStation/pull/10476 - https://github.com/TS-Rogue-Star/Rogue-Star/pull/702<br>
**License:** Licensed for use by VOREStation, Rogue Star, and their downstreams; unlicensed for further use without permission of copyright holder<br>
<br>
1 change: 1 addition & 0 deletions code/__defines/admin_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
//RS Add
#define SMITE_GIVECHEM "Give Reagent"
#define SMITE_PURGECHEM "Purge All Reagents"
#define SMITE_XP "Grant XP"
24 changes: 12 additions & 12 deletions code/game/objects/random/misc_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
spawn_nothing_percentage = 50

/obj/random/awayloot/item_to_spawn()
return pick(prob(50);/obj/item/weapon/aliencoin/basic,
prob(40);/obj/item/weapon/aliencoin/silver,
prob(30);/obj/item/weapon/aliencoin/gold,
prob(20);/obj/item/weapon/aliencoin/phoron,
return pick(//prob(50);/obj/item/weapon/aliencoin/basic, //RS TEMP REMOVAL
//prob(40);/obj/item/weapon/aliencoin/silver,
//prob(30);/obj/item/weapon/aliencoin/gold,
//prob(20);/obj/item/weapon/aliencoin/phoron,
prob(10);/obj/item/device/denecrotizer,
prob(5);/obj/item/capture_crystal,
prob(5);/obj/item/device/perfect_tele,
Expand Down Expand Up @@ -54,10 +54,10 @@

/obj/random/awayloot/looseloot
/obj/random/awayloot/looseloot/item_to_spawn()
return pick(prob(50);/obj/item/weapon/aliencoin,
prob(40);/obj/item/weapon/aliencoin/silver,
prob(30);/obj/item/weapon/aliencoin/gold,
prob(20);/obj/item/weapon/aliencoin/phoron,
return pick(//prob(50);/obj/item/weapon/aliencoin, //RS TEMP REMOVAL
//prob(40);/obj/item/weapon/aliencoin/silver,
//prob(30);/obj/item/weapon/aliencoin/gold,
//prob(20);/obj/item/weapon/aliencoin/phoron,
prob(10);/obj/item/device/denecrotizer,
prob(5);/obj/item/capture_crystal,
prob(3);/obj/item/capture_crystal/great,
Expand Down Expand Up @@ -109,10 +109,10 @@
spawn_nothing_percentage = 50

/obj/random/mainttoyloot/item_to_spawn()
return pick(prob(50);/obj/item/weapon/aliencoin/basic,
prob(40);/obj/item/weapon/aliencoin/silver,
prob(30);/obj/item/weapon/aliencoin/gold,
prob(20);/obj/item/weapon/aliencoin/phoron,
return pick(//prob(50);/obj/item/weapon/aliencoin/basic, //RS TEMP REMOVAL
//prob(40);/obj/item/weapon/aliencoin/silver,
//prob(30);/obj/item/weapon/aliencoin/gold,
//prob(20);/obj/item/weapon/aliencoin/phoron,
prob(5);/obj/item/capture_crystal,
prob(5);/obj/random/mouseray,
prob(5);/obj/item/device/perfect_tele,
Expand Down
5 changes: 4 additions & 1 deletion code/modules/admin/verbs/smite.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if(!istype(target))
return

var/list/smite_types = list(SMITE_BREAKLEGS,SMITE_BLUESPACEARTILLERY,SMITE_SPONTANEOUSCOMBUSTION,SMITE_LIGHTNINGBOLT,
var/list/smite_types = list(SMITE_XP,SMITE_BREAKLEGS,SMITE_BLUESPACEARTILLERY,SMITE_SPONTANEOUSCOMBUSTION,SMITE_LIGHTNINGBOLT,
SMITE_SHADEKIN_ATTACK,SMITE_SHADEKIN_NOMF,SMITE_AD_SPAM,SMITE_REDSPACE_ABDUCT,SMITE_AUTOSAVE,SMITE_AUTOSAVE_WIDE,SMITE_GIVECHEM,SMITE_PURGECHEM)

var/smite_choice = tgui_input_list(usr, "Select the type of SMITE for [target]","SMITE Type Choice", smite_types)
Expand Down Expand Up @@ -164,6 +164,9 @@
if(SMITE_PURGECHEM)
purge_chems(target, src)

if(SMITE_XP) //RS ADD
target.grant_xp() //RS ADD

else
return //Injection? Don't print any messages.

Expand Down
2 changes: 2 additions & 0 deletions code/modules/client/preference_setup/general/01_basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
if (!isnull(raw_name) && CanUseTopic(user))
var/new_name = sanitize_name(raw_name, pref.species, is_FBP())
if(new_name)
var/old_name = pref.real_name //RS ADD
pref.real_name = new_name
user.etching_rename(old_name, new_name) //RS ADD
return TOPIC_REFRESH
else
to_chat(user, "<span class='warning'>Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .</span>")
Expand Down
142 changes: 124 additions & 18 deletions code/modules/client/stored_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
density = FALSE
var/busy_bank = FALSE
var/static/list/item_takers = list()
var/static/list/unlockable_takers = list() //RS ADD

/obj/machinery/item_bank/proc/persist_item_savefile_path(mob/user)
return "data/player_saves/[copytext(user.ckey, 1, 2)]/[user.ckey]/persist_item.sav"
Expand Down Expand Up @@ -51,6 +52,12 @@
F["persist name"] >> persist_name
return persist_name

//RS ADD START
/obj/machinery/item_bank/proc/legacy_detect(mob/living/user)
if (fexists(src.persist_item_savefile_path(user)))
return TRUE
return FALSE
//RS ADD END

/obj/machinery/item_bank/Initialize()
. = ..()
Expand All @@ -72,16 +79,22 @@
to_chat(user, "<span class='warning'>\The [src] is already in use.</span>")
return
busy_bank = TRUE
var/I = persist_item_savefile_load(user, "type")
var/Iname = persist_item_savefile_load(user, "name")
var/choice = tgui_alert(user, "What would you like to do [src]?", "[src]", list("Check contents", "Retrieve item", "Info", "Cancel"), timeout = 10 SECONDS)
if(legacy_detect(user)) //RS EDIT START
if(tgui_alert(user, "A legacy item has been detected in storage. This item must be bound to a character. Would you like to add it to [user.real_name]'s general storage?", "[src] legacy item detected", list("Yes","No"), timeout = 10 SECONDS) == "Yes")

var/itemname = persist_item_savefile_load(user, "name")
var/itemtype = persist_item_savefile_load(user, "type")
user.etching.legacy_conversion(itemname,itemtype)
var/path = src.persist_item_savefile_path(user)
fdel(path)
log_debug("<span class = 'danger'>[user]/[user.ckey] converted a legacy item persist file to an item_storage state. Item was, [itemname] - [itemtype]</span>")
busy_bank = FALSE
return
var/choice = tgui_alert(user, "What would you like to do [src]?", "[src]", list("General", "Personal","Coin", "Info", "Cancel"), timeout = 10 SECONDS)
if(!choice || choice == "Cancel" || !Adjacent(user) || inoperable() || panel_open)
busy_bank = FALSE
return
else if(choice == "Check contents" && I)
to_chat(user, "<span class='notice'>\The [src] has \the [Iname] for you!</span>")
busy_bank = FALSE
else if(choice == "Retrieve item" && I)
else if(choice == "General") //RS EDIT END
if(user.hands_are_full())
to_chat(user,"<span class='notice'>Your hands are full!</span>")
busy_bank = FALSE
Expand All @@ -90,7 +103,17 @@
to_chat(user, "<span class='warning'>You have already taken something out of \the [src] this shift.</span>")
busy_bank = FALSE
return
choice = tgui_alert(user, "If you remove this item from the bank, it will be unable to be stored again. Do you still want to remove it?", "[src]", list("No", "Yes"), timeout = 10 SECONDS)
var/list/our_item = list() //RS EDIT START
if(user.etching.item_storage.len)
our_item = tgui_input_list(user, "Which item would you like to retrieve?", "[src] - General Compartment",user.etching.item_storage)
if(!our_item)
busy_bank = FALSE
return
else
to_chat(user, "<span class='warning'>\The [src] doesn't seem to have anything for you...</span>")
busy_bank = FALSE
return
choice = tgui_alert(user, "If you remove \the [our_item] from the bank, it will be unable to be stored again. Do you still want to remove it?", "[src]", list("No", "Yes"), timeout = 10 SECONDS) //RS EDIT END
icon_state = "item_bank_o"
if(!choice || choice == "No" || !Adjacent(user) || inoperable() || panel_open)
busy_bank = FALSE
Expand All @@ -100,26 +123,95 @@
busy_bank = FALSE
icon_state = "item_bank"
return
var/obj/N = new I(get_turf(src))
var/ourtype = user.etching.item_storage[our_item] //RS EDIT
var/obj/N = new ourtype(get_turf(src)) //RS EDIT
log_admin("[key_name_admin(user)] retrieved [N] from the item bank.")
visible_message("<span class='notice'>\The [src] dispenses the [N] to \the [user].</span>")
user.put_in_hands(N)
N.persist_storable = FALSE
var/path = src.persist_item_savefile_path(user)
var/savefile/F = new /savefile(src.persist_item_savefile_path(user))
F["persist item"] << null
F["persist name"] << null
fdel(path)
item_takers += user.ckey
user.etching.item_storage -= our_item //RS EDIT
user.etching.needs_saving = TRUE //RS EDIT
busy_bank = FALSE
icon_state = "item_bank"

else if(choice == "Info")
to_chat(user, "<span class='notice'>\The [src] can store a single item for you between shifts! Anything that has been retrieved from the bank cannot be stored again in the same shift. Anyone can withdraw from the bank one time per shift. Some items are not able to be accepted by the bank.</span>")
to_chat(user, "<span class='notice'>\The [src] can store items for you between shifts! Anything that has been retrieved from the bank cannot be stored again in the same shift. Anyone can withdraw from the bank one time per shift. Some items are not able to be accepted by the bank.</span>") //RS EDIT START
busy_bank = FALSE
return
else if(!I)
to_chat(user, "<span class='warning'>\The [src] doesn't seem to have anything for you...</span>")
else if(choice == "Personal")
if(!user.etching.unlockables.len)
to_chat(user, "<span class='warning'>Your personal storage is empty...</span>")
busy_bank = FALSE
return
var/our_item = tgui_input_list(user, "Which item would you like to retrieve?", "[src] - Personal Compartment",user.etching.unlockables)
if(!our_item)
busy_bank = FALSE
return

icon_state = "item_bank_o"
if(!choice || choice == "No" || !Adjacent(user) || inoperable() || panel_open)
busy_bank = FALSE
icon_state = "item_bank"
return

if("[user.real_name] - [our_item]" in unlockable_takers)
to_chat(user, "<span class='warning'>\The [src] buzzes. You have already claimed your [our_item] this shift.</span>")
busy_bank = FALSE
return

else if(!do_after(user, 10 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) || inoperable())
busy_bank = FALSE
icon_state = "item_bank"
return
var/ourtype = user.etching.unlockables[our_item]
var/obj/N = new ourtype(get_turf(src))
log_admin("[key_name_admin(user)] retrieved [N] from the item bank.")
visible_message("<span class='notice'>\The [src] dispenses the [N] to \the [user].</span>")
user.put_in_hands(N)
N.name = "[user]'s [N.name]"
N.persist_storable = FALSE
unlockable_takers += "[user.real_name] - [our_item]"
busy_bank = FALSE
icon_state = "item_bank"

else if(choice == "Coin")
if(user.etching)
var/datum/etching/E = user.etching
if(E.triangles <= 0)
to_chat(user, "<span class='warning'>You haven't got any coins banked...</span>")
busy_bank = FALSE
return
else
var/ourtris = tgui_input_number(user, "How much would you like to withdraw? You have ◬:[E.triangles] banked.", "Withdraw", timeout = 10 SECONDS)
if(ourtris <= 0)
busy_bank = FALSE
return
if(ourtris > E.triangles)
to_chat(user, "<span class='warning'>\The [src] buzzes at you and flashes red. You do not have ◬:[ourtris] banked. You have a balance of ◬:[E.triangles]...</span>")
busy_bank = FALSE
return
ourtris = round(ourtris)
E.triangles -= ourtris
visible_message("<span class='notice'>\The [src] rattles as it dispenses coins!</span>")
busy_bank = FALSE
var/turf/here = get_turf(src)
var/obj/item/weapon/aliencoin/A
while(ourtris > 0)
if(ourtris >= 1000)
A = new /obj/item/weapon/aliencoin/exotic(here)
else if(ourtris >= 100)
A = new /obj/item/weapon/aliencoin/diamond(here)
else if(ourtris >= 20)
A = new /obj/item/weapon/aliencoin/phoron(here)
else if(ourtris >= 10)
A = new /obj/item/weapon/aliencoin/gold(here)
else if(ourtris >= 5)
A = new /obj/item/weapon/aliencoin/silver(here)
else
A = new /obj/item/weapon/aliencoin/basic(here)
ourtris -= A.value
//RS EDIT END

/obj/machinery/item_bank/attackby(obj/item/O, mob/living/user)
if(!ishuman(user))
Expand All @@ -128,6 +220,19 @@
to_chat(user, "<span class='warning'>\The [src] is already in use.</span>")
return
busy_bank = TRUE
//RS EDIT BEGIN
if(istype(O, /obj/item/weapon/aliencoin))
if(user.etching)
var/obj/item/weapon/aliencoin/coin = O
user.update_etching("triangles", coin.value)
user.drop_item()
to_chat(user, "<span class='warning'>\The [src] SCHLORPS up \the [O]!!!</span>")
qdel(O)
busy_bank = FALSE
return
//RS EDIT END
user.etching.store_item(O,src)
/* //RS REMOVAL START - //Removed the old way of storing items, as it is no longer needed.
var/I = persist_item_savefile_load(user, "type")
if(!istool(O) && O.persist_storable)
if(ispath(I))
Expand Down Expand Up @@ -158,6 +263,7 @@
else
to_chat(user, "<span class='warning'>You cannot store \the [O]. \The [src] either does not accept that, or it has already been retrieved from storage this shift.</span>")
busy_bank = FALSE
*/ //RS REMOVAL END

/////STORABLE ITEMS AND ALL THAT JAZZ/////
//I am only really intending this to be used for single items. Mostly stuff you got right now, but can't/don't want to use right now.
Expand Down Expand Up @@ -255,4 +361,4 @@
/obj/item/weapon/spacecasinocash
persist_storable = FALSE
/obj/item/device/personal_shield_generator
persist_storable = FALSE
persist_storable = FALSE
13 changes: 13 additions & 0 deletions code/modules/economy/coins_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@
desc = "A curious triangular coin made primarily of some kind of dark, smooth metal. This one's markings appear to reveal a purple material underneath."
value = 20

//RS ADD START
/obj/item/weapon/aliencoin/diamond
name = "curious coin"
icon_state = "triangle-d"
desc = "A curious triangular coin made primarily of some kind of dark, smooth metal. This one's markings appear to reveal a shining material underneath."
value = 100

/obj/item/weapon/aliencoin/exotic
name = "curious coin"
icon_state = "triangle-e"
desc = "A curious triangular coin made primarily of some kind of dark, smooth metal. This one's markings appear to reveal a disturbing, absolutely black material underneath."
value = 1000
//RS ADD END

/obj/item/weapon/aliencoin/attack_self(mob/user as mob)
var/result = rand(1, sides)
Expand Down
Loading

0 comments on commit 92e6ec1

Please sign in to comment.