Objectives "steal plasma" and "steal AI" now correctly checks contents of backpacks.

Objectives code is made more compact and clear.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@908 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-01-23 23:11:02 +00:00
parent 0a8aef9c59
commit 39dd425219
3 changed files with 76 additions and 105 deletions
+5 -39
View File
@@ -221,48 +221,14 @@ datum/mind
new_objective.owner = src
if ("steal")
var/list/items = list("custom", "captain's antique laser gun", "hand teleporter", "RCD", "jetpack", "captains jumpsuit", "functional ai", "magnetic boots")
var/def_target = null
if (istype(objective, /datum/objective/steal))
def_target = objective:target_name
var/new_target = input("Select target:", "Objective target", def_target) as null|anything in items
if (!new_target) return
if (new_target == "custom")
var/steal_target = input("Select type:","Type") as null|anything in typesof(/obj/item)
if (!steal_target) return
var/tmp_obj = new steal_target
new_target = tmp_obj:name
del(tmp_obj)
new_target = input("Enter target name:", "Objective target", new_target) as text|null
if (!new_target) return
if (!istype(objective, /datum/objective/steal))
new_objective = new /datum/objective/steal
new_objective.owner = src
new_objective:steal_target = steal_target
else
new_objective = new /datum/objective/steal
new_objective.owner = src
switch(new_target)
if ("captain's antique laser gun")
new_objective:steal_target = /obj/item/weapon/gun/energy/laser_gun/captain
if ("hand teleporter")
new_objective:steal_target = /obj/item/weapon/hand_tele
if ("RCD")
new_objective:steal_target = /obj/item/weapon/rcd
if ("jetpack")
new_objective:steal_target = /obj/item/weapon/tank/jetpack
if ("captains jumpsuit")
new_objective:steal_target = /obj/item/clothing/under/rank/captain
if ("functional ai")
new_objective:steal_target = /obj/item/device/aicard
if ("magnetic boots")
new_objective:steal_target = /obj/item/clothing/shoes/magboots
new_objective:target_name = new_target
new_objective.explanation_text = "Steal a [new_target]."
new_objective = objective
var/datum/objective/steal/steal = new_objective
if (!steal.select_target())
return
if ("nuclear")
new_objective = new /datum/objective/nuclear