From 7ce9267a7dc4daa0c0de58e6442672fc27c2abd9 Mon Sep 17 00:00:00 2001 From: Incoming Date: Fri, 11 Dec 2015 19:32:32 -0500 Subject: [PATCH] The much beloved rpgloot wizard event has been intensified. Modifiers on items can now range between -15 and +15, though items will follow a normal distribution centered around 0. See the PR for exact odds. Additionally items armor values are now also affected by this event, and can add (or remove) up to 15 percent damage from all (defend-able) sources. Additionally a special new gimmick has been added, new "item fortification scrolls" will be thrown randomly into all containers with room to hold them (read: this mostly means things like backpacks). Using these scrolls on items allows you to rank them up one level (this doesn't change their name though, trust me it's too much to do for a silly event). BEWARE however that using these scrolls on items with very high modifiers (+10 or more) has a chance of failing and setting fire to the item. The highest possible modifier you can achieve with these scrolls is +19, though again the grand majority of items will burn well before this point. --- code/modules/events/wizard/rpgloot.dm | 45 +++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/code/modules/events/wizard/rpgloot.dm b/code/modules/events/wizard/rpgloot.dm index d9ad09ab906..636395194f7 100644 --- a/code/modules/events/wizard/rpgloot.dm +++ b/code/modules/events/wizard/rpgloot.dm @@ -9,11 +9,13 @@ var/list/prefixespositive = list("greater", "major", "blessed", "superior", "enpowered", "honed", "true", "glorious", "robust") var/list/prefixesnegative = list("lesser", "minor", "blighted", "inferior", "enfeebled", "rusted", "unsteady", "tragic", "gimped") var/list/suffixes = list("orc slaying", "elf slaying", "corgi slaying", "strength", "dexterity", "constitution", "intelligence", "wisdom", "charisma", "the forest", "the hills", "the plains", "the sea", "the sun", "the moon", "the void", "the world", "the fool", "many secrets", "many tales", "many colors", "rending", "sundering", "the night", "the day") - + var/upgrade_scroll_chance = 0 for(var/obj/item/I in world) if(istype(I,/obj/item/organ/)) continue - var/quality = rand(-5,5) + var/quality = pick(1;15, 2;14, 2;13, 2;12, 3;11, 3;10, 3;9, 4;8, 4;7, 4;6, 5;5, 5;4, 5;3, 6;2, 6;1, 6;0) + if(prob(50)) + quality = -quality if(quality > 0) I.name = "[pick(prefixespositive)] [I.name] of [pick(suffixes)] +[quality]" else if(quality < 0) @@ -21,7 +23,38 @@ else I.name = "[I.name] of [pick(suffixes)]" - I.force += quality - I.force = max(0,I.force) - I.throwforce += quality - I.throwforce = max(0,I.throwforce) \ No newline at end of file + I.force = max(0,I.force + quality) + I.throwforce = max(0,I.throwforce + quality) + I.armor += quality + + if(istype(I,/obj/item/weapon/storage)) + var/obj/item/weapon/storage/S = I + if(prob(upgrade_scroll_chance) && S.contents.len < S.storage_slots) + var/obj/item/upgradescroll/scroll = new + S.handle_item_insertion(scroll,1) + upgrade_scroll_chance = max(0,upgrade_scroll_chance-100) + upgrade_scroll_chance += 25 + +/obj/item/upgradescroll + name = "Item Fortification Scroll" + desc = "Somehow, this piece of paper can be applied to items to make them \"better\". Apparently there's a risk of losing the item if it's already \"too good\". This all feels so arbitrary..." + icon = 'icons/obj/wizard.dmi' + icon_state = "scroll" + w_class = 1 + +/obj/item/upgradescroll/afterattack(obj/item/target, mob/user , proximity) + if(!proximity || !istype(target)) + return + var/quality = target.force - initial(target.force) + if(quality > 9 && prob((quality - 9)*10)) + user << "[target] catches fire!" + if(target.burn_state == -1) + target.burn_state = 0 + target.fire_act() + qdel(src) + return + target.force += 1 + target.throwforce += 1 + target.armor += 1 + user << "[target] glows blue and seems vaguely \"better\"!" + qdel(src) \ No newline at end of file