Places bought wizard items into your hand instead of on the floor (#12470)

This commit is contained in:
SteelSlayer
2019-10-01 20:39:01 -04:00
committed by variableundefined
parent f1de76e500
commit 2c1fdb41eb
2 changed files with 19 additions and 14 deletions
+12 -10
View File
@@ -14,11 +14,13 @@
/datum/spellbook_entry/proc/IsSpellAvailable() // For config prefs / gamemode restrictions - these are round applied
return 1
/datum/spellbook_entry/proc/CanBuy(var/mob/living/carbon/human/user,var/obj/item/spellbook/book) // Specific circumstances
/datum/spellbook_entry/proc/CanBuy(mob/living/carbon/human/user, obj/item/spellbook/book) // Specific circumstances
if(book.uses<cost || limit == 0)
return 0
return 1
/datum/spellbook_entry/proc/Buy(var/mob/living/carbon/human/user,var/obj/item/spellbook/book) //return 1 on success
/datum/spellbook_entry/proc/Buy(mob/living/carbon/human/user, obj/item/spellbook/book) //return 1 on success
if(!S)
S = new spell_type()
@@ -56,7 +58,7 @@
to_chat(user, "<span class='notice'>You have learned [S.name].</span>")
return 1
/datum/spellbook_entry/proc/CanRefund(var/mob/living/carbon/human/user,var/obj/item/spellbook/book)
/datum/spellbook_entry/proc/CanRefund(mob/living/carbon/human/user, obj/item/spellbook/book)
if(!refundable)
return 0
if(!S)
@@ -66,7 +68,7 @@
return 1
return 0
/datum/spellbook_entry/proc/Refund(var/mob/living/carbon/human/user,var/obj/item/spellbook/book) //return point value or -1 for failure
/datum/spellbook_entry/proc/Refund(mob/living/carbon/human/user, obj/item/spellbook/book) //return point value or -1 for failure
var/area/wizard_station/A = locate()
if(!(user in A.contents))
to_chat(user, "<span clas=='warning'>You can only refund spells at the wizard lair</span>")
@@ -384,8 +386,8 @@
buy_word = "Summon"
var/item_path = null
/datum/spellbook_entry/item/Buy(var/mob/living/carbon/human/user,var/obj/item/spellbook/book)
new item_path(get_turf(user))
/datum/spellbook_entry/item/Buy(mob/living/carbon/human/user, obj/item/spellbook/book)
user.put_in_hands(new item_path)
feedback_add_details("wizard_spell_learned", log_name)
return 1
@@ -413,7 +415,7 @@
log_name = "SO"
category = "Artefacts"
/datum/spellbook_entry/item/scryingorb/Buy(var/mob/living/carbon/human/user,var/obj/item/spellbook/book)
/datum/spellbook_entry/item/scryingorb/Buy(mob/living/carbon/human/user, obj/item/spellbook/book)
if(..())
if(!(XRAY in user.mutations))
user.mutations.Add(XRAY)
@@ -430,7 +432,7 @@
log_name = "SS"
category = "Artefacts"
/datum/spellbook_entry/item/soulstones/Buy(var/mob/living/carbon/human/user,var/obj/item/spellbook/book)
/datum/spellbook_entry/item/soulstones/Buy(mob/living/carbon/human/user, obj/item/spellbook/book)
. = ..()
if(.)
user.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/construct(null))
@@ -637,7 +639,7 @@
OB.limit++
qdel(O)
/obj/item/spellbook/proc/GetCategoryHeader(var/category)
/obj/item/spellbook/proc/GetCategoryHeader(category)
var/dat = ""
switch(category)
if("Offensive")
@@ -672,7 +674,7 @@
dat += "Items are not bound to you and can be stolen. Additionaly they cannot typically be returned once purchased.<BR>"
return dat
/obj/item/spellbook/proc/wrap(var/content)
/obj/item/spellbook/proc/wrap(content)
var/dat = ""
dat +="<html><head><title>Spellbook</title></head>"
dat += {"
@@ -310,10 +310,13 @@
else
to_chat(src, "<span class='warning'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>")
/mob/living/carbon/human/put_in_hands(obj/item/W)
if(!W) return 0
if(put_in_active_hand(W)) return 1
else if(put_in_inactive_hand(W)) return 1
/mob/living/carbon/human/put_in_hands(obj/item/I)
if(!I)
return FALSE
if(put_in_active_hand(I))
return TRUE
else if(put_in_inactive_hand(I))
return TRUE
else
. = ..()