mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
Merge pull request #19940 from KorPhaeron/summons
Summon Magic now functions like summon guns
This commit is contained in:
@@ -713,25 +713,37 @@ 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(/obj/item)
|
||||
|
||||
/datum/objective/summon_guns/check_completion()
|
||||
/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!"
|
||||
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_typecache(I, wanted_items))
|
||||
stolen_count++
|
||||
if(stolen_count >= 5)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
// Changeling team objectives //
|
||||
////////////////////////////////
|
||||
|
||||
@@ -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.uses<cost || limit == 0)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/spellbook_entry/proc/Buy(mob/living/carbon/human/user,obj/item/weapon/spellbook/book) //return 1 on success
|
||||
if(!S || qdeleted(S))
|
||||
S = new spell_type()
|
||||
|
||||
//Check if we got the spell already
|
||||
for(var/obj/effect/proc_holder/spell/aspell in user.mind.spell_list)
|
||||
if(initial(S.name) == initial(aspell.name)) // Not using directly in case it was learned from one spellbook then upgraded in another
|
||||
@@ -445,7 +446,6 @@
|
||||
|
||||
/datum/spellbook_entry/summon/guns
|
||||
name = "Summon Guns"
|
||||
category = "Rituals"
|
||||
desc = "Nothing could possibly go wrong with arming a crew of lunatics just itching for an excuse to kill you. Just be careful not to stand still too long!"
|
||||
log_name = "SG"
|
||||
|
||||
@@ -457,15 +457,14 @@
|
||||
/datum/spellbook_entry/summon/guns/Buy(mob/living/carbon/human/user,obj/item/weapon/spellbook/book)
|
||||
feedback_add_details("wizard_spell_learned",log_name)
|
||||
rightandwrong(0, user, 25)
|
||||
active = 1
|
||||
playsound(get_turf(user),"sound/magic/CastSummon.ogg",50,1)
|
||||
user << "<span class='notice'>You have cast summon guns!</span>"
|
||||
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 << "<span class='notice'>You have cast summon magic and gained an extra charge for your spellbook.</span>"
|
||||
user << "<span class='notice'>You have cast summon magic!</span>"
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user