Skip to content

Commit

Permalink
-Syndies should spawn next to their sleepers and not ontop of eachother.
Browse files Browse the repository at this point in the history
-equip_to_appropriate_slot will now return whether it's successful or not.
-Fixed the receivers and broadcasters being the wrong preset.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4250 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
[email protected] committed Jul 31, 2012
1 parent 38a6299 commit 16919d9
Show file tree
Hide file tree
Showing 3 changed files with 2,462 additions and 2,457 deletions.
54 changes: 27 additions & 27 deletions code/game/gamemodes/nuclear/nuclear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,40 @@
////////////////////////////////////////////////////////////////////////////////////////

/datum/game_mode/nuclear/post_setup()
var/obj/effect/landmark/synd_spawn = locate("landmark*Syndicate-Spawn")

var/list/turf/synd_spawn = list()

for (var/obj/effect/landmark/A in world)
if (A.name == "Syndicate-Gear-Closet")
new /obj/structure/closet/syndicate/personal(A.loc)
del(A)
continue

if (A.name == "Syndicate-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(A.loc)
del(A)
continue

if(A.name == "Syndicate-Spawn")
synd_spawn += get_turf(A)
del(A)
continue

var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb")
var/obj/effect/landmark/closet_spawn = locate("landmark*Nuclear-Closet")

var/nuke_code = "[rand(10000, 99999)]"
var/leader_selected = 0
var/agent_number = 1
var/spawnpos = agent_number

for(var/datum/mind/synd_mind in syndicates)
synd_mind.current.loc = get_turf(synd_spawn)
spawnpos = (agent_number >= synd_spawn.len ? 1 : spawnpos + 1)
synd_mind.current.loc = synd_spawn[spawnpos]

forge_syndicate_objectives(synd_mind)
greet_syndicate(synd_mind)

equip_syndicate(synd_mind.current)

if(!leader_selected)
prepare_syndicate_leader(synd_mind, nuke_code)
Expand All @@ -131,29 +151,17 @@
synd_mind.current.real_name = "[syndicate_name()] Operative #[agent_number]"
agent_number++

equip_syndicate(synd_mind.current)
update_synd_icons_added(synd_mind)

update_all_synd_icons()

if(nuke_spawn)
if(nuke_spawn && synd_spawn.len > 0)
var/obj/machinery/nuclearbomb/the_bomb = new /obj/machinery/nuclearbomb(nuke_spawn.loc)
the_bomb.r_code = nuke_code

if(closet_spawn)
new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc)

for (var/obj/effect/landmark/A in world)
if (A.name == "Syndicate-Gear-Closet")
new /obj/structure/closet/syndicate/personal(A.loc)
del(A)
continue

if (A.name == "Syndicate-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(A.loc)
del(A)
continue

spawn (rand(waittime_l, waittime_h))
send_intercept()

Expand All @@ -175,19 +183,11 @@
P.loc = synd_mind.current.loc
else
var/mob/living/carbon/human/H = synd_mind.current
var/list/slots = list (
"backpack" = H.slot_in_backpack,
"left pocket" = H.slot_l_store,
"right pocket" = H.slot_r_store,
"left hand" = H.slot_l_hand,
"right hand" = H.slot_r_hand,
)
var/where = H.equip_in_one_of_slots(P, slots, del_on_fail=0)
if (!where)
P.loc = H.loc
P.loc = H.loc
H.equip_if_possible(P, H.slot_r_store, 0)

else
nuke_code = "code will be proveded later"
nuke_code = "code will be provided later"
synd_mind.current << "Nuclear Explosives 101:\n\tHello and thank you for choosing the Syndicate for your nuclear information needs.\nToday's crash course will deal with the operation of a Fusion Class Nanotrasen made Nuclear Device.\nFirst and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.\nPressing any button on the compacted bomb will cause it to extend and bolt itself into place.\nIf this is done to unbolt it one must compeltely log in which at this time may not be possible.\nTo make the device functional:\n1. Place bomb in designated detonation zone\n2. Extend and anchor bomb (attack with hand).\n3. Insert Nuclear Auth. Disk into slot.\n4. Type numeric code into keypad ([nuke_code]).\n\tNote: If you make a mistake press R to reset the device.\n5. Press the E button to log onto the device\nYou now have activated the device. To deactivate the buttons at anytime for example when\nyou've already prepped the bomb for detonation remove the auth disk OR press the R ont he keypad.\nNow the bomb CAN ONLY be detonated using the timer. A manual det. is not an option.\n\tNote: Nanotrasen is a pain in the neck.\nToggle off the SAFETY.\n\tNote: You wouldn't believe how many Syndicate Operatives with doctorates have forgotten this step\nSo use the - - and + + to set a det time between 5 seconds and 10 minutes.\nThen press the timer toggle button to start the countdown.\nNow remove the auth. disk so that the buttons deactivate.\n\tNote: THE BOMB IS STILL SET AND WILL DETONATE\nNow before you remove the disk if you need to move the bomb you can:\nToggle off the anchor, move it, and re-anchor.\n\nGood luck. Remember the order:\nDisk, Code, Safety, Timer, Disk, RUN!\nIntelligence Analysts believe that they are hiding the disk in the bridge. Your space ship will not leave until the bomb is armed and timing.\nGood luck!"
return

Expand Down
40 changes: 22 additions & 18 deletions code/modules/mob/living/carbon/human/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,97 +29,98 @@
return null

//puts the item "W" into an appropriate slot in a human's inventory
//returns 0 if it cannot, 1 if successful
/mob/living/carbon/human/proc/equip_to_appropriate_slot(obj/item/W)
if(!W) return
if(!ishuman(src)) return
if(!W) return 0
if(!ishuman(src)) return 0

if(W.slot_flags & SLOT_BACK)
if(!back)
if( get_active_hand() == W )
u_equip(W)
back = W
update_inv_back()
return
return 1

if(W.slot_flags & SLOT_ID)
if(!wear_id && w_uniform)
if( get_active_hand() == W )
u_equip(W)
wear_id = W
update_inv_wear_id()
return
return 1

if(W.slot_flags & SLOT_ICLOTHING)
if(!w_uniform)
if( get_active_hand() == W )
u_equip(W)
w_uniform = W
update_inv_w_uniform()
return
return 1

if(W.slot_flags & SLOT_OCLOTHING)
if(!wear_suit)
if( get_active_hand() == W )
u_equip(W)
wear_suit = W
update_inv_wear_suit()
return
return 1

if(W.slot_flags & SLOT_MASK)
if(!wear_mask)
if( get_active_hand() == W )
u_equip(W)
wear_mask = W
update_inv_wear_mask()
return
return 1

if(W.slot_flags & SLOT_HEAD)
if(!head)
if( get_active_hand() == W )
u_equip(W)
head = W
update_inv_head()
return
return 1

if(W.slot_flags & SLOT_FEET)
if(!shoes)
if( get_active_hand() == W )
u_equip(W)
shoes = W
update_inv_shoes()
return
return 1

if(W.slot_flags & SLOT_GLOVES)
if(!gloves)
if( get_active_hand() == W )
u_equip(W)
gloves = W
update_inv_gloves()
return
return 1

if(W.slot_flags & SLOT_EARS)
if(!ears)
if( get_active_hand() == W )
u_equip(W)
ears = W
update_inv_ears()
return
return 1

if(W.slot_flags & SLOT_EYES)
if(!glasses)
if( get_active_hand() == W )
u_equip(W)
glasses = W
update_inv_glasses()
return
return 1

if(W.slot_flags & SLOT_BELT)
if(!belt && w_uniform)
if( get_active_hand() == W )
u_equip(W)
belt = W
update_inv_belt()
return
return 1

//Suit storage
var/confirm
Expand All @@ -133,7 +134,7 @@
u_equip(W)
s_store = W
update_inv_s_store()
return
return 1

//Pockets
if ( !( W.slot_flags & SLOT_DENYPOCKET ) )
Expand All @@ -142,23 +143,26 @@
u_equip(W)
l_store = W
update_inv_pockets()
return
return 1
if(!r_store)
if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) )
u_equip(W)
r_store = W
update_inv_pockets()
return
return 1
return 0


/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/
//warning: icky code
var/equipped = 0
if((slot == l_store || slot == r_store || slot == belt || slot == wear_id) && !src.w_uniform)
del(W)
if(del_on_fail)
del(W)
return
if(slot == s_store && !src.wear_suit)
del(W)
if(del_on_fail)
del(W)
return
switch(slot)
if(slot_back)
Expand Down
Loading

0 comments on commit 16919d9

Please sign in to comment.