forked from Sandstorm-Station/Sandstorm-Station-13
-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Lambda-and-meta-fixin' of https://github.com/SaraSayomi…
…/S.P.L.U.R.T-Station-13-Sara-Sayomi into Lambda-and-meta-fixin
- Loading branch information
Showing
21 changed files
with
239 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
2024-09-07: | ||
MosleyTheMalO: | ||
- bugfix: Fixes the overall sprite | ||
- rscadd: adds a new polychromic sprite | ||
- rscadd: donator item | ||
SandPoot: | ||
- rscadd: Added Character offering system, exchange characters with people you want | ||
to! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
modular_sand/code/modules/character_giving/character_giving.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#define REDEMPTION_CODE_GENERATION_ATTEMPTS 5 | ||
|
||
GLOBAL_LIST_INIT(character_offers, list()) | ||
|
||
/datum/character_offer_instance | ||
var/owner_ckey | ||
var/savefile/character_savefile | ||
var/redemption_code | ||
|
||
/datum/character_offer_instance/New(owner_ckey, character_savefile) | ||
. = ..() | ||
if(!owner_ckey || !character_savefile) | ||
qdel(src) | ||
return | ||
src.owner_ckey = owner_ckey | ||
src.character_savefile = character_savefile | ||
|
||
// 5 digit number, no fucking way some idiot is guessing this | ||
var/attempts = 0 | ||
while(!redemption_code || LAZYFIND(GLOB.character_offers, redemption_code)) | ||
if(attempts >= REDEMPTION_CODE_GENERATION_ATTEMPTS) | ||
qdel(src) | ||
return | ||
redemption_code = "[random_nukecode()]" | ||
attempts++ | ||
|
||
LAZYSET(GLOB.character_offers, redemption_code, src) | ||
|
||
/datum/character_offer_instance/Destroy(force, ...) | ||
var/datum/preferences/to_remove = LAZYACCESS(GLOB.preferences_datums, owner_ckey) | ||
to_remove.offer = null | ||
LAZYREMOVE(GLOB.character_offers, redemption_code) | ||
owner_ckey = null | ||
character_savefile = null | ||
redemption_code = null | ||
return ..() | ||
|
||
/datum/character_offer_instance/proc/on_quit() | ||
qdel(src) | ||
|
||
#undef REDEMPTION_CODE_GENERATION_ATTEMPTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/obj/item/clothing/head/mob_holder/micro/verb/interact_with() | ||
set name = "Interact With" | ||
set desc = "Perform an interaction with someone." | ||
set category = "IC" | ||
set src in view(usr.client) | ||
|
||
var/datum/component/interaction_menu_granter/menu = usr.GetComponent(/datum/component/interaction_menu_granter) | ||
if(!menu) | ||
to_chat(usr, span_warning("You must have done something really bad to not have an interaction component.")) | ||
return | ||
|
||
if(!src) | ||
to_chat(usr, span_warning("Your interaction target is gone!")) | ||
return | ||
menu.open_menu(usr, held_mob) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.