From 331763d0c4a4cf46a6f588e573d0a55892d96ece Mon Sep 17 00:00:00 2001 From: coiax Date: Fri, 10 Feb 2017 16:06:14 +0000 Subject: [PATCH] Revert "Soapstones now have a fixed vocabulary (and rating system!)" (#23909) --- code/modules/library/soapstone.dm | 158 ++++++++------------ strings/soapstone_prefixes.txt | 14 -- strings/soapstone_suffixes.json | 234 ------------------------------ 3 files changed, 63 insertions(+), 343 deletions(-) delete mode 100644 strings/soapstone_prefixes.txt delete mode 100644 strings/soapstone_suffixes.json diff --git a/code/modules/library/soapstone.dm b/code/modules/library/soapstone.dm index a313d6aa0f7..a512f12125d 100644 --- a/code/modules/library/soapstone.dm +++ b/code/modules/library/soapstone.dm @@ -1,40 +1,22 @@ -#define SOAPSTONE_PREFIX_FILE "strings/soapstone_prefixes.txt" -#define SOAPSTONE_SUFFIX_FILE "soapstone_suffixes.json" -//Vocabulary lists; soapstones use a prefix and a suffix. Optionally, they can have a prefix and suffix, then a conjunction that links another set. -var/global/list/soapstone_prefixes = list() //Read from "strings/soapstone_prefixes.txt"; if you're adding your own, put **** where the subject should be! -var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffixes.json" /obj/item/soapstone name = "chisel" - desc = "Leave \"informative\" messages for the crew, including the crew of future shifts!\n\ - (Not suitable for engraving on shuttles, off station or on cats. Side effects may include beatings, bannings and orbital bombardment.)" + desc = "Leave informative messages for the crew, including the crew of future shifts!\nEven if out of uses, it can still be used to remove messages.\n(Not suitable for engraving on shuttles, off station or on cats. Side effects may include beatings, bannings and orbital bombardment.)" icon = 'icons/obj/items.dmi' icon_state = "soapstone" throw_speed = 3 throw_range = 5 w_class = WEIGHT_CLASS_TINY + var/tool_speed = 50 var/remaining_uses = 3 var/non_dull_name + var/w_engrave = "engrave" + var/w_engraving = "engraving" + var/w_chipping = "chipping" var/w_dull = "dull" /obj/item/soapstone/New() . = ..() - if(!soapstone_prefixes.len) - soapstone_prefixes = file2list(SOAPSTONE_PREFIX_FILE, "\n") - if(!soapstone_suffixes.len) - soapstone_suffixes = list(\ - "Characters" = strings(SOAPSTONE_SUFFIX_FILE, "Characters"), \ - "Careers" = strings(SOAPSTONE_SUFFIX_FILE, "Careers"), \ - "Antagonists" = strings(SOAPSTONE_SUFFIX_FILE, "Antagonists"), \ - "Objects" = strings(SOAPSTONE_SUFFIX_FILE, "Objects"), \ - "Techniques" = strings(SOAPSTONE_SUFFIX_FILE, "Techniques"), \ - "Actions" = strings(SOAPSTONE_SUFFIX_FILE, "Actions"), \ - "Geography" = strings(SOAPSTONE_SUFFIX_FILE, "Geography"), \ - "Orientation" = strings(SOAPSTONE_SUFFIX_FILE, "Orientation"), \ - "Body parts" = strings(SOAPSTONE_SUFFIX_FILE, "Body parts"), \ - "Concepts" = strings(SOAPSTONE_SUFFIX_FILE, "Concepts"), \ - "Musings" = strings(SOAPSTONE_SUFFIX_FILE, "Musings"), \ - ) random_name() check_name() // could start empty @@ -43,6 +25,9 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi non_dull_name = name if(name == "chalk" || name == "magic marker") desc = replacetext(desc, "engraving", "scribbling") + w_engrave = "scribble" + w_engraving = "scribbling" + w_chipping = "sketching" if(name == "chalk") w_dull = "used" if(name == "magic marker") @@ -50,6 +35,9 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi if(name == "soapstone" || name == "chisel") desc = replacetext(desc, "scribbling", "engraving") + w_engrave = initial(w_engrave) + w_engraving = initial(w_engraving) + w_chipping = initial(w_chipping) w_dull = "dull" /obj/item/soapstone/examine(mob/user) @@ -60,48 +48,59 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi user << "It looks like it can be used an unlimited number of times." /obj/item/soapstone/afterattack(atom/target, mob/user, proximity) - if(!remaining_uses) - user << "[src] is [w_dull] and can't be used anymore!" - return var/turf/T = get_turf(target) if(!proximity) return - var/obj/structure/chisel_message/msg = locate() in T - if(msg) - if(msg.creator_key != user.ckey) - user << "There's already a message there!" - return - else - if(alert(user, "Erase this message?", name, "Yes", "No") == "Yes") - user.visible_message("[user] erases [msg].", "You permanently erase [msg].") - playsound(T, 'sound/items/gavel.ogg', 50, 1) - refund_use() - msg.persists = 0 - qdel(msg) - return - return + + + var/obj/structure/chisel_message/already_message = locate(/obj/structure/chisel_message) in T + + var/our_message = FALSE + if(already_message) + our_message = already_message.creator_key == user.ckey + + if(!remaining_uses && !already_message) + // The dull chisel is dull. + user << "[src] is [w_dull]." + return + if(!good_chisel_message_location(T)) - user << "You can't write there!" + user << "It's not appropriate to [w_engrave] on [T]." return - var/prefix = input(user, "Choose a prefix for your message.", name) as null|anything in soapstone_prefixes - if(!prefix) + + if(already_message) + user.visible_message("[user] starts erasing [already_message].", "You start erasing [already_message].", "You hear a [w_chipping] sound.") + playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1) + + // Removing our own messages refunds a charge + + if(do_after(user, tool_speed, target=target)) + user.visible_message("[user] has erased [already_message].", "You erased [already_message].") + already_message.persists = FALSE + qdel(already_message) + playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1) + if(our_message) + refund_use() return - var/suffix_category_string = input(user, "Choose a suffix category.", "[prefix]...") as null|anything in soapstone_suffixes - var/list/suffix_category = soapstone_suffixes[suffix_category_string] - if(!suffix_category || !suffix_category.len) + + var/message = stripped_input(user, "What would you like to [w_engrave]?", "[name] Message") + if(!message) + user << "You decide not to [w_engrave] anything." return - var/suffix = input(user, "Choose a suffix.", "[prefix]...") as null|anything in suffix_category - if(!suffix) + + if(!target.Adjacent(user) && locate(/obj/structure/chisel_message) in T) + user << "You decide not to [w_engrave] anything." return - var/processed_message = replacetext(prefix, "****", suffix) - if(!user.Adjacent(T) || !good_chisel_message_location(T) || locate(/obj/structure/chisel_message) in T) - return - user.visible_message("[user] writes a message onto [T]!", "You write a message onto [T].") - playsound(T, 'sound/items/gavel.ogg', 50, 1) - var/obj/structure/chisel_message/M = new(T) - M.register(user, processed_message) - remove_use() - return 1 + + playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1) + user.visible_message("[user] starts [w_engraving] a message into [T].", "You start [w_engraving] a message into [T].", "You hear a [w_chipping] sound.") + if(can_use() && do_after(user, tool_speed, target=T) && can_use()) + if(!locate(/obj/structure/chisel_message in T)) + user << "You [w_engrave] a message into [T]." + playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1) + var/obj/structure/chisel_message/M = new(T) + M.register(user, message) + remove_use() /obj/item/soapstone/proc/can_use() if(remaining_uses == -1 || remaining_uses >= 0) @@ -172,34 +171,6 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi var/map var/persists = TRUE - var/positive_ratings = 0 - var/negative_ratings = 0 - - var/list/raters = list() //Ckeys who have rated this message - -/obj/structure/chisel_message/attack_hand(mob/user) - if(user.ckey == creator_key) - user << "You can't rate your own messages!" - return - if(raters[user.ckey]) - user << "You've already rated this message!" - return - switch(alert(user, "How would you like to rate this message?", "Message Rating", "Positive", "Negative", "Cancel")) - if("Positive") - for(var/client/C in clients) - if(C.ckey == creator_key) - C.mob << "One of your messages was rated as positive!" - user << "You rated this message as positive." - positive_ratings++ - raters[user.ckey] = "positive" - if("Negative") - for(var/client/C in clients) - if(C.ckey == creator_key) - C.mob << "One of your messages was rated as negative!" - user << "You rated this message as negative." - negative_ratings++ - raters[user.ckey] = "negative" - /obj/structure/chisel_message/New(newloc) ..() SSpersistence.chisel_messages += src @@ -219,6 +190,12 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi map = MAP_NAME update_icon() +/obj/structure/chisel_message/update_icon() + ..() + var/hash = md5(hidden_message) + var/newcolor = copytext(hash, 1, 7) + add_atom_colour("#[newcolor]", FIXED_COLOUR_PRIORITY) + /obj/structure/chisel_message/proc/pack() var/list/data = list() data["hidden_message"] = hidden_message @@ -229,9 +206,6 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi var/turf/T = get_turf(src) data["x"] = T.x data["y"] = T.y - data["pos_ratings"] = positive_ratings - data["neg_ratings"] = positive_ratings - data["raters"] = raters return data /obj/structure/chisel_message/proc/unpack(list/data) @@ -239,9 +213,6 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi creator_name = data["creator_name"] creator_key = data["creator_key"] realdate = data["realdate"] - positive_ratings = data["pos_ratings"] - negative_ratings = data["neg_ratings"] - raters = data["raters"] var/x = data["x"] var/y = data["y"] @@ -251,10 +222,7 @@ var/global/list/soapstone_suffixes = list() //Read from "strings/soapstone_suffi /obj/structure/chisel_message/examine(mob/user) ..() - user << "[hidden_message]" - user << "Ratings: [positive_ratings] [negative_ratings]" - if(raters[user.ckey]) - user << "You rated this message as [raters[user.ckey]]." + user << "[hidden_message]" /obj/structure/chisel_message/Destroy() if(persists) diff --git a/strings/soapstone_prefixes.txt b/strings/soapstone_prefixes.txt deleted file mode 100644 index 728e0739830..00000000000 --- a/strings/soapstone_prefixes.txt +++ /dev/null @@ -1,14 +0,0 @@ -**** -****? -****! -try **** -**** ahead -be wary of **** -need **** -imminent **** -weakness: **** -huh, it's a ****... -visions of ****.... -could this be a ****? -time for **** -praise the ****! \ No newline at end of file diff --git a/strings/soapstone_suffixes.json b/strings/soapstone_suffixes.json deleted file mode 100644 index 2b2ab81a481..00000000000 --- a/strings/soapstone_suffixes.json +++ /dev/null @@ -1,234 +0,0 @@ -{ - "Characters": [ - "human", - "lizard", - "monkey", - "xeno", - "slimeperson", - "snowflake", - "enemy", - "tough enemy", - "Nanotrasen", - "Syndicate", - "skeleton", - "flier", - "statue", - "monster", - "strange creature", - "demon", - "boss", - "dark spirit", - "saint", - "wretch", - "charmer", - "miscreant", - "liar", - "fatty", - "beanpole", - "merchant", - "prisoner" - ], - - "Careers": [ - "assistant", - "captain", - "head of personnel", - "head of security", - "warden", - "security officer", - "detective", - "chief engineer", - "engineer", - "atmos tech", - "research director", - "scientist", - "robotics", - "chief medical officer", - "doctor", - "chemist", - "geneticist", - "virologist", - "janitor", - "bartender", - "cook", - "clown", - "mime", - "chaplain", - "librarian", - "quartermaster", - "cargo tech", - "miner", - "lawyer", - "AI", - "cyborg", - "drone", - "pAI" - ], - - "Antagonists": [ - "traitor", - "changeling", - "nuke op", - "wizard", - "alien", - "ghost", - "blob", - "cultist", - "devil" - ], - - "Objects": [ - "airlock", - "table", - "rack", - "weapon", - "trap", - "false wall", - "window", - "item", - "loot", - "teleporter", - "blueprints", - "boots", - "clothes", - "clothing", - "drugs", - "medicine", - "crate", - "locker", - "handcuffs", - "plant", - "food", - "drink", - "tool", - "amazing item", - "amazing loot", - "amazing clothing", - "amazing drugs", - "amazing rack" - ], - - "Techniques": [ - "close-ranged battle", - "ranged battle", - "eliminating one at a time", - "luring it out", - "beating to a pulp", - "lying in ambush", - "stealth", - "fleeing", - "charging", - "stabbing in the back" - ], - - "Actions": [ - "attacking", - "hacking", - "sneaking", - "slipping", - "running", - "walking", - "sprinting", - "running away", - "holding with both hands", - "jumping", - "restraining", - "crying", - "cheering" - ], - - "Geography": [ - "hallway", - "room", - "corridor", - "airlock", - "space", - "hidden path", - "gorgeous view", - "open area", - "tight spot", - "tunnel", - "dark area", - "bright area", - "shuttle", - "pod", - "security", - "arrivals", - "escape", - "engineering", - "atmospherics", - "medbay", - "science", - "brig", - "prison", - "asteroid", - "cargo", - "mining", - "cave", - "maintenance" - ], - - "Orientation": [ - "front", - "back", - "left", - "right", - "up", - "down", - "north", - "south", - "east", - "west", - "northeast", - "northwest", - "southeast", - "southwest", - "that way" - ], - - "Body parts": [ - "head", - "neck", - "stomach", - "back", - "arm", - "leg", - "heel", - "rear", - "tail", - "wings", - "anywhere", - "everywhere" - ], - - "Concepts": [ - "chance", - "hint", - "secret", - "happiness", - "sorrow", - "life", - "death", - "elation", - "grief", - "hope", - "despair", - "light", - "dark", - "bravery", - "resignation", - "comfort", - "tears" - ], - - "Musings": [ - "I can't take this...", - "it'll happen to you too", - "you don't deserve this", - "you bastard", - "you can do it", - "don't give up", - "don't you dare", - "do it" - ] -} \ No newline at end of file