Merge pull request #748 from SkyMarshal/Airlocks

New Objective system (WIPish), as well as fixes for #747, #734, #733, as well as fixing the portalathe, and moving the be_syndicate var up to the client.
This commit is contained in:
Albert Iordache
2012-03-25 00:47:36 -07:00
22 changed files with 1250 additions and 188 deletions
+1 -1
View File
@@ -423,7 +423,7 @@
#include "code\game\gamemodes\game_mode.dm"
#include "code\game\gamemodes\gameticker.dm"
#include "code\game\gamemodes\intercept_report.dm"
#include "code\game\gamemodes\objective.dm"
#include "code\game\gamemodes\newobjective.dm"
#include "code\game\gamemodes\setupgame.dm"
#include "code\game\gamemodes\autotraitor\autotraitor.dm"
#include "code\game\gamemodes\blob\blob.dm"
+3 -2
View File
@@ -12,7 +12,8 @@
if(!istype(target, /obj/machinery/light))
return
var/obj/machinery/light/L = target
if(L.stat > 1) //Burned or broke
L.stat = 0
if(L.status > 1) //Burned or broke
L.status = 0
L.update()
user.visible_message("[user] repairs \the [target] on the spot with their [src]!","You repair the lightbulb!")
return
+4
View File
@@ -57,6 +57,7 @@
var/revival_pod_plants = 1
var/revival_cloning = 1
var/revival_brain_life = -1
var/require_heads_alive = 0 //For Rev.
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
@@ -242,6 +243,9 @@
if("alert_delta")
config.alert_desc_delta = value
if("require_heads_alive")
config.require_heads_alive = value
else
diary << "Unknown setting in configuration: '[name]'"
+5 -11
View File
@@ -330,7 +330,7 @@ datum/mind
possible_targets += possible_target.current
var/mob/def_target = null
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/decapitate)
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protection, /datum/objective/debrain, /datum/objective/decapitate)
if (objective&&(objective.type in objective_list) && objective:target)
def_target = objective:target.current
@@ -367,19 +367,13 @@ datum/mind
new_objective.owner = src
if ("steal")
if (!istype(objective, /datum/objective/steal))
new_objective = new /datum/objective/steal
new_objective.owner = src
else
new_objective = objective
var/datum/objective/steal/steal = new_objective
if (!steal.select_target())
return
new_objective = pick(GenerateTheft(assigned_role,src))
new_objective.owner = src
if("download","capture","absorb")
var/def_num
if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]"))
def_num = objective.target_amount
def_num = objective:target_amount
var/target_number = input("Input target number:", "Objective", def_num) as num|null
if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
@@ -396,7 +390,7 @@ datum/mind
new_objective = new /datum/objective/absorb
new_objective.explanation_text = "Absorb [target_number] compatible genomes."
new_objective.owner = src
new_objective.target_amount = target_number
new_objective:target_amount = target_number
if ("custom")
var/expl = input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null
+1
View File
@@ -27,6 +27,7 @@
var/played = 0
var/team = null
var/warned = 0
var/be_syndicate = 0 //Moving this into client vars, since I was silly when I made it.
var/STFU_ghosts //80+ people rounds are fun to admin when text flies faster than airport security
var/STFU_radio //80+ people rounds are fun to admin when text flies faster than airport security
+1 -1
View File
@@ -168,7 +168,7 @@
var/logged_in = 0
var/underwear = 1//Human
var/be_syndicate = 0 //This really should be a client variable. EDIT: Hijacked for my own nefarious purposes! --SkyMarshal
// var/be_syndicate = 0 //This really should be a client variable. EDIT: Hijacked for my own nefarious purposes! --SkyMarshal
var/be_random_name = 0
var/const/blindness = 1//Carbon
var/const/deafness = 2//Carbon
+2 -5
View File
@@ -782,9 +782,6 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
ok = (check_1 || check_2)
if(check_1 || check_2)
ok = 1
// ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
/*
@@ -914,7 +911,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
return
proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target)
/proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( srcturf )
if(targetturf.density && targetturf != get_turf(target))
@@ -929,7 +926,7 @@ proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target)
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in targetturf)
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle))
if(!border_obstacle.CanPass(D, srcturf, 1, 0))
del D
return 0
+4 -5
View File
@@ -241,10 +241,9 @@ In either case, it's a good idea to spawn the ninja with a semi-random set of ob
hostile_targets -= current_mind//Remove them from the list.
if(2)//Steal
var/datum/objective/steal/ninja_objective = new
var/target_item = pick(ninja_objective.possible_items_special)
ninja_objective.set_target(target_item)
ninja_mind.objectives += ninja_objective
var/list/datum/objective/theft = GenerateTheft(ninja_mind.assigned_role,ninja_mind)
var/datum/objective/steal/steal_objective = pick(theft)
ninja_mind.objectives += steal_objective
objective_list -= 2
if(3)//Protect. Keeping people alive can be pretty difficult.
@@ -252,7 +251,7 @@ In either case, it's a good idea to spawn the ninja with a semi-random set of ob
current_mind = pick(friendly_targets)
if(current_mind)
var/datum/objective/protect/ninja_objective = new
var/datum/objective/protection/ninja_objective = new
ninja_objective.owner = ninja_mind
ninja_objective.find_target_by_role((current_mind.special_role ? current_mind.special_role : current_mind.assigned_role),(current_mind.special_role?1:0))
ninja_mind.objectives += ninja_objective
@@ -82,7 +82,7 @@
playercount += 1
if (player.client && player.mind && player.mind.special_role && player.stat != 2)
traitorcount += 1
if (player.client && player.mind && !player.mind.special_role && player.stat != 2 && (player.be_syndicate & BE_TRAITOR) && !jobban_isbanned(player, "Syndicate"))
if (player.client && player.mind && !player.mind.special_role && player.stat != 2 && (player.client && player.client.be_syndicate & BE_TRAITOR) && !jobban_isbanned(player, "Syndicate"))
possible_traitors += player
for(var/datum/mind/player in possible_traitors)
for(var/job in restricted_jobs)
@@ -170,7 +170,7 @@
if(emergency_shuttle.departed)
return
//message_admins("Late Join Check")
if((character.be_syndicate & BE_TRAITOR) && !jobban_isbanned(character, "Syndicate"))
if((character.client && character.client.be_syndicate & BE_TRAITOR) && !jobban_isbanned(character, "Syndicate"))
//message_admins("Late Joiner has Be Syndicate")
//message_admins("Checking number of players")
var/playercount = 0
+4 -4
View File
@@ -101,9 +101,9 @@
if(46 to 90)
var/datum/objective/steal/steal_objective = new
var/list/datum/objective/theft = GenerateTheft(changeling.assigned_role,changeling)
var/datum/objective/steal/steal_objective = pick(theft)
steal_objective.owner = changeling
steal_objective.find_target()
changeling.objectives += steal_objective
if (!(locate(/datum/objective/escape) in changeling.objectives))
@@ -118,9 +118,9 @@
kill_objective.find_target()
changeling.objectives += kill_objective
var/datum/objective/steal/steal_objective = new
var/list/datum/objective/theft = GenerateTheft(changeling.assigned_role,changeling)
var/datum/objective/steal/steal_objective = pick(theft)
steal_objective.owner = changeling
steal_objective.find_target()
changeling.objectives += steal_objective
if (!(locate(/datum/objective/survive) in changeling.objectives))
File diff suppressed because it is too large Load Diff
@@ -183,7 +183,7 @@
for(var/mob/living/carbon/human/player in world)
if(player.client)
if(player.be_syndicate & BE_REV)
if(player.client.be_syndicate & BE_REV)
candidates += player.mind
if(candidates.len < 1)
+4 -96
View File
@@ -88,102 +88,9 @@
traitor.objectives += block_objective
else
for(var/i = 1, i <= rand(1,3), i++)
switch(rand(1,100))
if(1 to 30)
if(!locate(/datum/objective/assassinate) in traitor.objectives && !locate(/datum/objective/protect) in traitor.objectives)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
traitor.objectives += kill_objective
else
var/works = 1
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
for(var/j, j < (traitor.objectives.len + 1), j++)
var/compare = istype(traitor.objectives[j],/datum/objective/assassinate)
if(compare)
var/datum/objective/assassinate/test = traitor.objectives[j]
if(test.target == kill_objective.target)
works = 0
break
compare = istype(traitor.objectives[j],/datum/objective/protect)
if(compare)
var/datum/objective/protect/test = traitor.objectives[j]
if(test.target == kill_objective.target)
works = 0
break
if(works)
traitor.objectives += kill_objective
else
i -= 1
if(31 to 40)
if(!locate(/datum/objective/assassinate) in traitor.objectives && !locate(/datum/objective/protect) in traitor.objectives)
var/datum/objective/protect/protect_objective = new
protect_objective.owner = traitor
protect_objective.find_target()
traitor.objectives += protect_objective
else
var/works = 1
var/datum/objective/protect/protect_objective = new
protect_objective.owner = traitor
protect_objective.find_target()
for(var/j, j < (traitor.objectives.len + 1), j++)
var/compare = istype(traitor.objectives[j],/datum/objective/assassinate)
if(compare)
var/datum/objective/assassinate/test = traitor.objectives[j]
if(test.target == protect_objective.target)
works = 0
break
compare = istype(traitor.objectives[j],/datum/objective/protect)
if(compare)
var/datum/objective/protect/test = traitor.objectives[j]
if(test.target == protect_objective.target)
works = 0
break
if(works)
traitor.objectives += protect_objective
else
i -= 1
else
if(!locate(/datum/objective/steal) in traitor.objectives)
var/datum/objective/steal/steal_objective = new
steal_objective.owner = traitor
steal_objective.find_target()
traitor.objectives += steal_objective
else
var/works = 1
var/datum/objective/steal/steal_objective = new
steal_objective.owner = traitor
steal_objective.find_target()
for(var/j, j < (traitor.objectives.len + 1), j++)
var/compare = istype(traitor.objectives[j],/datum/objective/steal)
if(compare)
var/datum/objective/steal/test = traitor.objectives[j]
if(test.target_name == steal_objective.target_name)
works = 0
break
if(works)
traitor.objectives += steal_objective
else
i -= 1
if (!(locate(/datum/objective/escape) in traitor.objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = traitor
traitor.objectives += escape_objective
/* switch(rand(1,100))
if(1 to 90)
if (!(locate(/datum/objective/escape) in traitor.objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = traitor
traitor.objectives += escape_objective
else
if (!(locate(/datum/objective/hijack) in traitor.objectives))
var/datum/objective/hijack/hijack_objective = new
hijack_objective.owner = traitor
traitor.objectives += hijack_objective*/
for(var/datum/objective/o in SelectObjectives((traitor.current:wear_id ? traitor.current:wear_id:assignment : traitor.assigned_role), traitor))
o.owner = traitor
traitor.objectives += o
return
@@ -328,6 +235,7 @@
loc = "on your head"
if (!R)
traitor_mob << "Unfortunately, the Syndicate wasn't able to get you an uplink."
traitor_mob << "\red <b>ADMINHELP THIS AT ONCE.</b>"
. = 0
else
if (istype(R, /obj/item/device/radio))
+1 -44
View File
@@ -62,50 +62,7 @@
/datum/game_mode/proc/forge_wizard_objectives(var/datum/mind/wizard)
switch(rand(1,100))
if(1 to 30)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = wizard
kill_objective.find_target()
wizard.objectives += kill_objective
if (!(locate(/datum/objective/escape) in wizard.objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = wizard
wizard.objectives += escape_objective
if(31 to 60)
var/datum/objective/steal/steal_objective = new
steal_objective.owner = wizard
steal_objective.find_target()
wizard.objectives += steal_objective
if (!(locate(/datum/objective/escape) in wizard.objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = wizard
wizard.objectives += escape_objective
if(61 to 85)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = wizard
kill_objective.find_target()
wizard.objectives += kill_objective
var/datum/objective/steal/steal_objective = new
steal_objective.owner = wizard
steal_objective.find_target()
wizard.objectives += steal_objective
if (!(locate(/datum/objective/survive) in wizard.objectives))
var/datum/objective/survive/survive_objective = new
survive_objective.owner = wizard
wizard.objectives += survive_objective
else
if (!(locate(/datum/objective/hijack) in wizard.objectives))
var/datum/objective/hijack/hijack_objective = new
hijack_objective.owner = wizard
wizard.objectives += hijack_objective
wizard.objectives = SelectObjectives("Wizard",wizard,1)
return
+15
View File
@@ -117,3 +117,18 @@ var/list/nonhuman_positions = list(
/proc/guest_jobbans(var/job)
return ((job in command_positions) || (job in nonhuman_positions) || (job in security_positions))
/proc/GetRank(var/job)
switch(job)
if("Bartender","Chef","Lawyer","Librarian","Janitor","Assistant","Unassigned")
return 0
if("Chaplain","Botanist","Hydroponicist","Medical Doctor","Atmospheric Technician","Geneticist")
return 1
if("Quartermaster","Cargo Technician","Chemist", "Engineer","Roboticist", "Security Officer", "Forensic Technician","Detective", "Scientist","Shaft Miner")
return 2
if("Research Director","Chief Medical Officer","Head of Security","Chief Engineer","Warden")
return 3
if("Captain","Head of Personnel","Wizard")
return 4
else
world << "\"[job]\" NOT GIVEN RANK, REPORT JOBS.DM ERROR TO <del>SKYMARSHAL</del> A CODER"
+10 -10
View File
@@ -6,7 +6,7 @@
var/list/authorized = list( )
/* attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob)
attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob)
if(stat & (BROKEN|NOPOWER)) return
if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
@@ -14,23 +14,23 @@
var/obj/item/device/pda/pda = W
W = pda.id
if (!W:access) //no access
user << "The access level of [W:registered]\'s card is not high enough. "
user << "The access level of [W:registered_name]\'s card is not high enough. "
return
var/list/cardaccess = W:access
if(!istype(cardaccess, /list) || !cardaccess.len) //no access
user << "The access level of [W:registered]\'s card is not high enough. "
user << "The access level of [W:registered_name]\'s card is not high enough. "
return
if(!(access_heads in W:access)) //doesn't have this access
user << "The access level of [W:registered]\'s card is not high enough. "
user << "The access level of [W:registered_name]\'s card is not high enough. "
return 0
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
switch(choice)
if("Authorize")
src.authorized -= W:registered
src.authorized += W:registered
src.authorized -= W:registered_name
src.authorized += W:registered_name
if (src.auth_need - src.authorized.len > 0)
message_admins("[key_name_admin(user)] has authorized early shuttle launch")
log_game("[user.ckey] has authorized early shuttle launch")
@@ -45,7 +45,7 @@
src.authorized = list( )
if("Repeal")
src.authorized -= W:registered
src.authorized -= W:registered_name
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
if("Abort")
@@ -53,12 +53,12 @@
src.authorized.len = 0
src.authorized = list( )
else if (istype(W, /obj/item/weapon/card/emag))
/* else if (istype(W, /obj/item/weapon/card/emag))
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
switch(choice)
if("Launch")
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
emergency_shuttle.settimeleft( 10 )
if("Cancel")
return
return */
return*/
return
+1 -2
View File
@@ -15,9 +15,8 @@
ticker.mode.traitors += H.mind
H.mind.special_role = "traitor"
var/datum/objective/steal/steal_objective = new
var/datum/objective/steal/nuke_disk/steal_objective = new
steal_objective.owner = H.mind
steal_objective.set_target("nuclear authentication disk")
H.mind.objectives += steal_objective
var/datum/objective/hijack/hijack_objective = new
+20
View File
@@ -101,6 +101,26 @@
return 1
return 0
/mob/living/proc/check_contents_for_reagent(A)
var/list/L = list()
L += src.contents
for(var/obj/item/weapon/storage/S in L)
L |= S.return_inv()
for(var/obj/item/weapon/gift/G in L)
L |= G.gift
if (istype(G.gift, /obj/item/weapon/storage))
L |= G.gift:return_inv()
for(var/obj/item/weapon/evidencebag/E in L)
L |= E:contents
for(var/obj/item/smallDelivery/S in L)
L |= S.wrapped
for(var/obj/item/weapon/reagent_containers/B in L)
for(var/datum/reagent/R in B.reagents.reagent_list)
if(R.type == A)
return 1
return 0
/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
return 0 //only carbon liveforms have this proc
+1 -1
View File
@@ -106,7 +106,7 @@
src.see_in_dark = 0
src.see_invisible = 0
if (((!loc.master.power_equip) || istype(T, /turf/space)) && !istype(src.loc,/obj/item))
if (((!loc.master.power_equip) || istype(T, /turf/space)) && !istype(src.loc,/obj/item) && !istype(get_area(src), /area/shuttle))
if (src:aiRestorePowerRoutine==0)
src:aiRestorePowerRoutine = 1
+2 -1
View File
@@ -265,7 +265,8 @@
job_master.EquipRank(character, rank, 1)
EquipCustomItems(character)
character.loc = pick(latejoin)
character.be_syndicate = src.preferences.be_special
if(character.client)
character.client.be_syndicate = preferences.be_special
ticker.mode.latespawn(character)
AnnounceArrival(character, rank)
+1 -1
View File
@@ -862,7 +862,6 @@ datum/preferences
character.age = age
character.dna.b_type = b_type
character.be_syndicate = be_special
character.r_eyes = r_eyes
character.g_eyes = g_eyes
@@ -906,6 +905,7 @@ datum/preferences
character.client.ooccolor = ooccolor
character.client.be_alien = be_special&BE_ALIEN
character.client.be_pai = be_special&BE_PAI
character.client.be_syndicate = be_special
proc/copydisabilities(mob/living/carbon/human/character)
if(disabilities & 1)
+1 -1
View File
@@ -109,7 +109,7 @@
else // Any other
A.yo = -20
A.xo = 0
A.process()
A.fired()
attackby(obj/item/W, mob/user)