From f3200ee88a0f28751343765f9677eca3a86755c3 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Wed, 17 Aug 2016 19:33:32 -0500 Subject: [PATCH 1/3] Summon Magic --- code/datums/mind.dm | 3 --- code/game/gamemodes/objective.dm | 25 +++++++++++++------ code/game/gamemodes/wizard/spellbook.dm | 13 ++++------ .../spells/spell_types/rightandwrong.dm | 17 +++++++++---- 4 files changed, 34 insertions(+), 24 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 045b87e3eb3..f232917cda4 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1443,7 +1443,6 @@ ticker.mode.wizards += src special_role = "Wizard" assigned_role = "Wizard" - //ticker.mode.learn_basic_spells(current) if(!wizardstart.len) current.loc = pick(latejoin) current << "HOT INSERTION, GO GO GO" @@ -1451,8 +1450,6 @@ current.loc = pick(wizardstart) ticker.mode.equip_wizard(current) - for(var/obj/item/weapon/spellbook/S in current.contents) - S.op = 0 ticker.mode.name_wizard(current) ticker.mode.forge_wizard_objectives(src) ticker.mode.greet_wizard(src) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 595aa17c6e1..184cc22b495 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -704,18 +704,27 @@ var/global/list/possible_items_special = list() else explanation_text = "Free Objective" -/datum/objective/summon_guns - explanation_text = "Steal at least five guns!" +/datum/objective/steal_five_of_type + explanation_text = "Steal at least five items!" + var/list/wanted_items = list() -/datum/objective/summon_guns/check_completion() +/datum/objective/steal_five_of_type/summon_guns + explanation_text = "Steal at least five guns!" + wanted_items = list(/obj/item/weapon/gun) + +/datum/objective/steal_five_of_type/summon_magic + explanation_text = "Steal at least five magical artefacts!" + wanted_items = list(/obj/item/weapon/spellbook, /obj/item/weapon/gun/magic, /obj/item/clothing/suit/space/hardsuit/wizard, /obj/item/weapon/scrying, /obj/item/weapon/antag_spawner/contract, /obj/item/device/necromantic_stone) + +/datum/objective/steal_five_of_type/check_completion() if(!isliving(owner.current)) return 0 - var/guncount = 0 + var/stolen_count = 0 var/list/all_items = owner.current.GetAllContents() //this should get things in cheesewheels, books, etc. - for(var/obj/I in all_items) //Check for guns - if(istype(I, /obj/item/weapon/gun)) - guncount++ - if(guncount >= 5) + for(var/obj/I in all_items) //Check for wanted items + if(is_type_in_list(I, wanted_items)) + stolen_count++ + if(stolen_count >= 5) return 1 else return 0 diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index ec4ad68610e..9cb69da31c9 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -14,14 +14,15 @@ /datum/spellbook_entry/proc/IsAvailible() // For config prefs / gamemode restrictions - these are round applied return 1 + /datum/spellbook_entry/proc/CanBuy(mob/living/carbon/human/user,obj/item/weapon/spellbook/book) // Specific circumstances if(book.usesYou have cast summon guns!" return 1 /datum/spellbook_entry/summon/magic name = "Summon Magic" - category = "Challenges" desc = "Share the wonders of magic with the crew and show them why they aren't to be trusted with it at the same time." - cost = 0 log_name = "SU" /datum/spellbook_entry/summon/magic/IsAvailible() @@ -475,11 +474,10 @@ /datum/spellbook_entry/summon/magic/Buy(mob/living/carbon/human/user,obj/item/weapon/spellbook/book) feedback_add_details("wizard_spell_learned",log_name) - rightandwrong(1, user, 0) - book.uses += 1 + rightandwrong(1, user, 25) active = 1 playsound(get_turf(user),"sound/magic/CastSummon.ogg",50,1) - user << "You have cast summon magic and gained an extra charge for your spellbook." + user << "You have cast summon magic!" return 1 /datum/spellbook_entry/summon/events @@ -518,7 +516,6 @@ w_class = 1 var/uses = 10 var/temp = null - var/op = 1 var/tab = null var/mob/living/carbon/human/owner var/list/datum/spellbook_entry/entries = list() diff --git a/code/modules/spells/spell_types/rightandwrong.dm b/code/modules/spells/spell_types/rightandwrong.dm index 0e9deacf093..29e3e10e9ac 100644 --- a/code/modules/spells/spell_types/rightandwrong.dm +++ b/code/modules/spells/spell_types/rightandwrong.dm @@ -15,15 +15,22 @@ if(H.mind.special_role == "Wizard" || H.mind.special_role == "apprentice" || H.mind.special_role == "survivalist") continue if(prob(survivor_probability) && !(H.mind in ticker.mode.traitors)) ticker.mode.traitors += H.mind - var/datum/objective/summon_guns/guns = new - guns.owner = H.mind - H.mind.objectives += guns - H.mind.special_role = "survivalist" + if(!summon_type) + var/datum/objective/steal_five_of_type/summon_guns/guns = new + guns.owner = H.mind + H.mind.objectives += guns + H.mind.special_role = "survivalist" + H << "You are the survivalist! Your own safety matters above all else, and the only way to ensure your safety is to stockpile weapons! Grab as many guns as possible, by any means necessary. Kill anyone who gets in your way." + else + var/datum/objective/steal_five_of_type/summon_magic/magic = new + magic.owner = H.mind + H.mind.objectives += magic + H.mind.special_role = "amateur magician" + H << "You are the amateur magician! Grow your newfound talent! Grab as many magical artefacts as possible, by any means necessary. Kill anyone who gets in your way." var/datum/objective/survive/survive = new survive.owner = H.mind H.mind.objectives += survive H.attack_log += "\[[time_stamp()]\] Was made into a survivalist, and trusts no one!" - H << "You are the survivalist! Your own safety matters above all else, and the only way to ensure your safety is to stockpile weapons! Grab as many guns as possible, by any means necessary. Kill anyone who gets in your way." H.mind.announce_objectives() var/randomizeguns = pick(gunslist) var/randomizemagic = pick(magiclist) From ffaf54f492fa807e15b5d4b2b49775168237ff21 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 18 Aug 2016 19:37:57 -0500 Subject: [PATCH 2/3] Uses a typecache for reasons I'm honestly unsure of --- code/game/gamemodes/objective.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 184cc22b495..810d25df6f7 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -706,7 +706,11 @@ var/global/list/possible_items_special = list() /datum/objective/steal_five_of_type explanation_text = "Steal at least five items!" - var/list/wanted_items = list() + var/list/wanted_items = list(/obj/item) + +/datum/objective/steal_five_of_type/New() + ..() + wanted_items = typecacheof(wanted_items) /datum/objective/steal_five_of_type/summon_guns explanation_text = "Steal at least five guns!" @@ -731,7 +735,6 @@ var/global/list/possible_items_special = list() return 0 - //////////////////////////////// // Changeling team objectives // //////////////////////////////// From 0cd64e4749039749a20af200296911551b46f2e3 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 18 Aug 2016 19:40:18 -0500 Subject: [PATCH 3/3] It would make more sense if I actually used a typecache though --- code/game/gamemodes/objective.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 810d25df6f7..946fcdef335 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -726,7 +726,7 @@ var/global/list/possible_items_special = list() var/stolen_count = 0 var/list/all_items = owner.current.GetAllContents() //this should get things in cheesewheels, books, etc. for(var/obj/I in all_items) //Check for wanted items - if(is_type_in_list(I, wanted_items)) + if(is_type_in_typecache(I, wanted_items)) stolen_count++ if(stolen_count >= 5) return 1