-Added a "landmarks_list"; the game will now check for landmarks in the list instead of the world.

-Did some optimizing to AI freelook.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4670 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-09-09 22:27:06 +00:00
parent e01bf78933
commit 384b2717b0
19 changed files with 54 additions and 36 deletions

View File

@@ -409,7 +409,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
call(/datum/game_mode/proc/equip_syndicate)(new_character)
if("Space Ninja")
var/ninja_spawn[] = list()
for(var/obj/effect/landmark/L in world)
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name=="carpspawn")
ninja_spawn += L
new_character.equip_space_ninja()

View File

@@ -63,7 +63,7 @@ var/global/sent_strike_team = 0
commandos += candidate//Add their ghost to commandos.
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in world)
for(var/obj/effect/landmark/L in landmarks_list)
if(commando_number<=0) break
if (L.name == "Commando")
leader_selected = commando_number == 1?1:0
@@ -86,14 +86,14 @@ var/global/sent_strike_team = 0
commando_number--
//Spawns the rest of the commando gear.
for (var/obj/effect/landmark/L)
for (var/obj/effect/landmark/L in landmarks_list)
if (L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
var/obj/item/weapon/paper/P = new(L.loc)
P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
P.name = "Spec. Ops. Manual"
for (var/obj/effect/landmark/L in world)
for (var/obj/effect/landmark/L in landmarks_list)
if (L.name == "Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
del(L)

View File

@@ -63,7 +63,7 @@ var/global/sent_syndicate_strike_team = 0
commandos += candidate//Add their ghost to commandos.
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in world)
for(var/obj/effect/landmark/L in landmarks_list)
if(syndicate_commando_number<=0) break
if (L.name == "Syndicate-Commando")
syndicate_leader_selected = syndicate_commando_number == 1?1:0
@@ -93,7 +93,7 @@ var/global/sent_syndicate_strike_team = 0
// P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
// P.name = "Spec. Ops. Manual"
for (var/obj/effect/landmark/L in world)
for (var/obj/effect/landmark/L in landmarks_list)
if (L.name == "Syndicate-Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
del(L)

View File

@@ -47,7 +47,7 @@ proc/createRandomZlevel()
if(isfile(file))
maploader.load_map(file)
for(var/obj/effect/landmark/L in world)
for(var/obj/effect/landmark/L in landmarks_list)
if (L.name != "awaystart")
continue
awaydestinations.Add(L)

View File

@@ -47,10 +47,12 @@ var/datum/cameranet/cameranet = new()
var/list/remove = ai.visibleCameraChunks - visibleChunks
var/list/add = visibleChunks - ai.visibleCameraChunks
for(var/datum/camerachunk/c in remove)
for(var/chunk in remove)
var/datum/camerachunk/c = chunk
c.remove(ai)
for(var/datum/camerachunk/c in add)
for(var/chunk in add)
var/datum/camerachunk/c = chunk
c.add(ai)
// Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open.

View File

@@ -69,8 +69,10 @@
continue
for(var/turf/t in c.can_see())
if(t in turfs)
newVisibleTurfs += t
newVisibleTurfs += t
// Removes turf that isn't in turfs.
newVisibleTurfs &= turfs
var/list/visAdded = newVisibleTurfs - visibleTurfs
var/list/visRemoved = visibleTurfs - newVisibleTurfs
@@ -79,20 +81,24 @@
obscuredTurfs = turfs - newVisibleTurfs
for(var/turf/t in visAdded)
for(var/turf in visAdded)
var/turf/t = turf
if(t.obscured)
obscured -= t.obscured
for(var/mob/aiEye/m in seenby)
for(var/eye in seenby)
var/mob/aiEye/m = eye
if(m.ai.client)
m.ai.client.images -= t.obscured
for(var/turf/t in visRemoved)
for(var/turf in visRemoved)
var/turf/t = turf
if(t in obscuredTurfs)
if(!t.obscured)
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
obscured += t.obscured
for(var/mob/aiEye/m in seenby)
for(var/eye in seenby)
var/mob/aiEye/m = eye
if(!m)
seenby -= m
if(m.ai.client)
@@ -115,17 +121,21 @@
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
turfs += t
for(var/obj/machinery/camera/c in cameras)
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c.can_use())
continue
for(var/turf/t in c.can_see())
if(t in turfs)
visibleTurfs += t
visibleTurfs += t
// Removes turf that isn't in turfs.
visibleTurfs &= turfs
obscuredTurfs = turfs - visibleTurfs
for(var/turf/t in obscuredTurfs)
for(var/turf in obscuredTurfs)
var/turf/t = turf
if(!t.obscured)
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
obscured += t.obscured

View File

@@ -22,7 +22,7 @@
player_list |= src
var/list/watch_locations = list()
for(var/obj/effect/landmark/landmark in world)
for(var/obj/effect/landmark/landmark in landmarks_list)
if(landmark.tag == "landmark*new_player")
watch_locations += landmark.loc

View File

@@ -84,21 +84,21 @@
O.key = key
var/obj/loc_landmark
for(var/obj/effect/landmark/start/sloc in world)
for(var/obj/effect/landmark/start/sloc in landmarks_list)
if (sloc.name != "AI")
continue
if (locate(/mob/living) in sloc.loc)
continue
loc_landmark = sloc
if (!loc_landmark)
for(var/obj/effect/landmark/tripai in world)
for(var/obj/effect/landmark/tripai in landmarks_list)
if (tripai.name == "tripai")
if(locate(/mob/living) in tripai.loc)
continue
loc_landmark = tripai
if (!loc_landmark)
O << "Oh god sorry we can't find an unoccupied AI spawn location, so we're spawning you on top of someone."
for(var/obj/effect/landmark/start/sloc in world)
for(var/obj/effect/landmark/start/sloc in landmarks_list)
if (sloc.name == "AI")
loc_landmark = sloc