Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into newmalf-merge

This commit is contained in:
Atlantiscze
2015-05-05 22:13:58 +02:00
1007 changed files with 35445 additions and 31335 deletions
+9
View File
@@ -48,6 +48,11 @@
#define ui_monkey_mask "5:14,1:5" //monkey
#define ui_monkey_back "6:14,1:5" //monkey
#define ui_construct_health "15:00,7:15" //same height as humans, hugging the right border
#define ui_construct_purge "15:00,6:15"
#define ui_construct_fire "14:16,8:13" //above health, slightly to the left
#define ui_construct_pull "14:28,2:10" //above the zone_sel icon
//Lower right, persistant menu
#define ui_dropbutton "11:22,1:5"
#define ui_drop_throw "14:28,2:7"
@@ -66,6 +71,7 @@
#define ui_gun2 "14:28, 4:7"
#define ui_gun3 "13:26,4:7"
#define ui_gun_select "14:28,3:7"
#define ui_gun4 "12:24,3:7"
//Upper-middle right (damage indicators)
#define ui_toxin "14:28,13:27"
@@ -118,3 +124,6 @@
#define ui_iarrowleft "SOUTH-1,11"
#define ui_iarrowright "SOUTH-1,13"
#define ui_spell_master "14:16,14:16"
#define ui_genetic_master "14:16,12:16"
+6 -1
View File
@@ -33,7 +33,7 @@ var/list/global_huds = list(
screen.screen_loc = "1,1"
screen.icon = 'icons/obj/hud_full.dmi'
screen.icon_state = icon_state
screen.layer = 17
screen.layer = SCREEN_LAYER
screen.mouse_opacity = 0
return screen
@@ -249,7 +249,11 @@ datum/hud/New(mob/owner)
robot_hud()
else if(isobserver(mymob))
ghost_hud()
else
mymob.instantiate_hud(src)
/mob/proc/instantiate_hud(var/datum/hud/HUD)
return
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
/mob/verb/button_pressed_F12(var/full = 0 as null)
@@ -337,6 +341,7 @@ datum/hud/New(mob/owner)
if(src.hud_used.item_action_list)
src.client.screen -= src.hud_used.item_action_list
src.client.screen -= src.internals
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
else
hud_used.hud_shown = 1
if(src.hud_used.adding)
+3
View File
@@ -356,6 +356,9 @@
//mymob.gun_run_icon.color = ui_color
mymob.gun_run_icon.alpha = ui_alpha
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
mymob.radio_use_icon.alpha = ui_alpha
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.set_dir(2)
+4
View File
@@ -231,6 +231,10 @@
if (mymob.client.target_can_click)
mymob.item_use_icon.set_dir(1)
src.adding += mymob.item_use_icon
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
if (mymob.client.target_can_radio)
mymob.radio_use_icon.set_dir(1)
src.adding += mymob.radio_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.set_dir(1)
+56
View File
@@ -101,3 +101,59 @@
mymob.client.screen += src.adding
return
/mob/living/simple_animal/construct/instantiate_hud(var/datum/hud/HUD)
HUD.construct_hud()
/datum/hud/proc/construct_hud()
var/constructtype
if(istype(mymob,/mob/living/simple_animal/construct/armoured) || istype(mymob,/mob/living/simple_animal/construct/behemoth))
constructtype = "juggernaut"
else if(istype(mymob,/mob/living/simple_animal/construct/builder))
constructtype = "artificer"
else if(istype(mymob,/mob/living/simple_animal/construct/wraith))
constructtype = "wraith"
else if(istype(mymob,/mob/living/simple_animal/construct/harvester))
constructtype = "harvester"
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
if(constructtype)
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_construct.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_construct_fire
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_construct.dmi'
mymob.healths.icon_state = "[constructtype]_health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_construct_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_construct.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_construct_pull
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_construct.dmi'
mymob.zone_sel.overlays.len = 0
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.purged = new /obj/screen()
mymob.purged.icon = 'icons/mob/screen1_construct.dmi'
mymob.purged.icon_state = "purge0"
mymob.purged.name = "purged"
mymob.purged.screen_loc = ui_construct_purge
mymob.client.screen = null
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged, mymob.flash)
+4
View File
@@ -162,6 +162,10 @@ var/obj/screen/robot_inventory
if (mymob.client.target_can_click)
mymob.item_use_icon.set_dir(1)
src.adding += mymob.item_use_icon
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
if (mymob.client.target_can_radio)
mymob.radio_use_icon.set_dir(1)
src.adding += mymob.radio_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.set_dir(1)
+20 -31
View File
@@ -14,6 +14,9 @@
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/gun_click_time = -100 //I'm lazy.
/obj/screen/Destroy()
master = null
..()
/obj/screen/text
icon = null
@@ -122,6 +125,11 @@
screen_loc = ui_gun_select
//dir = 1
radio
name = "Allow Radio Use"
icon_state = "no_radio0"
screen_loc = ui_gun4
/obj/screen/zone_sel
name = "damage zone"
icon_state = "zone_sel"
@@ -427,7 +435,7 @@
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(3)
if("Allow Walking")
if("Allow Walking", "Disallow Walking")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
@@ -436,16 +444,7 @@
usr.client.AllowTargetMove()
gun_click_time = world.time
if("Disallow Walking")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetMove()
gun_click_time = world.time
if("Allow Running")
if("Allow Running", "Disallow Running")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
@@ -454,26 +453,7 @@
usr.client.AllowTargetRun()
gun_click_time = world.time
if("Disallow Running")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRun()
gun_click_time = world.time
if("Allow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()
gun_click_time = world.time
if("Disallow Item Use")
if("Allow Item Use", "Disallow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
@@ -485,6 +465,15 @@
if("Toggle Gun Mode")
usr.client.ToggleGunMode()
if("Allow Radio Use", "Disallow Radio Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.get_active_hand(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRadio()
gun_click_time = world.time
else
return 0
return 1
+175
View File
@@ -0,0 +1,175 @@
/obj/screen/movable/spell_master
name = "Spells"
icon = 'icons/mob/screen_spells.dmi'
icon_state = "wiz_spell_ready"
var/list/obj/screen/spell/spell_objects = list()
var/showing = 0
var/open_state = "master_open"
var/closed_state = "master_closed"
screen_loc = ui_spell_master
var/mob/spell_holder
/obj/screen/movable/spell_master/MouseDrop()
if(showing)
return
return ..()
/obj/screen/movable/spell_master/Click()
if(!spell_objects.len)
qdel(src)
return
toggle_open()
/obj/screen/movable/spell_master/proc/toggle_open(var/forced_state = 0)
if(showing && (forced_state != 2))
for(var/obj/screen/spell/O in spell_objects)
if(spell_holder && spell_holder.client)
spell_holder.client.screen -= O
O.handle_icon_updates = 0
showing = 0
overlays.len = 0
overlays.Add(closed_state)
else if(forced_state != 1)
var/temp_loc = screen_loc
var/x_position = text2num(copytext(temp_loc, 1, findtext(temp_loc, ":")))
var/x_pix = text2num(copytext(temp_loc, findtext(temp_loc, ":") + 1, findtext(temp_loc, ",")))
temp_loc = copytext(temp_loc, findtext(temp_loc, ",") + 1)
var/y_position = text2num(copytext(temp_loc, 1, findtext(temp_loc, ":")))
var/y_pix = text2num(copytext(temp_loc, findtext(temp_loc, ":")+1))
for(var/i = 1; i <= spell_objects.len; i++)
var/obj/screen/spell/S = spell_objects[i]
S.screen_loc = "[x_position + (x_position < 8 ? 1 : -1)*(i%7)]:[x_pix],[y_position + (y_position < 8 ? round(i/7) : -round(i/7))]:[y_pix]"
if(spell_holder && spell_holder.client)
spell_holder.client.screen += S
S.handle_icon_updates = 1
update_spells(1)
showing = 1
overlays.len = 0
overlays.Add(open_state)
/obj/screen/movable/spell_master/proc/add_spell(var/spell/spell)
if(!spell) return
for(var/obj/screen/spell/spellscreen in spell_objects)
if(spellscreen.spell == spell)
return
if(spell.spell_flags & NO_BUTTON) //no button to add if we don't get one
return
var/obj/screen/spell/newscreen = new
newscreen.spell = spell
if(!spell.override_base) //if it's not set, we do basic checks
if(spell.spell_flags & CONSTRUCT_CHECK)
newscreen.spell_base = "const" //construct spells
else
newscreen.spell_base = "wiz" //wizard spells
else
newscreen.spell_base = spell.override_base
newscreen.name = spell.name
newscreen.update_charge(1)
spell_objects.Add(newscreen)
toggle_open(2) //forces the icons to refresh on screen
/obj/screen/movable/spell_master/proc/remove_spell(var/spell/spell)
for(var/obj/screen/spell/s_object in spell_objects)
if(s_object.spell == spell)
spell_objects.Remove(s_object)
qdel(s_object)
break
if(spell_objects.len)
toggle_open(showing + 1)
else
spell_holder.spell_masters.Remove(src)
qdel(src)
/obj/screen/movable/spell_master/proc/silence_spells(var/amount)
for(var/obj/screen/spell/spell in spell_objects)
spell.spell.silenced = amount
spell.update_charge(1)
/obj/screen/movable/spell_master/proc/update_spells(forced = 0, mob/user)
if(user && user.client)
if(!(src in user.client.screen))
user.client.screen += src
for(var/obj/screen/spell/spell in spell_objects)
spell.update_charge(forced)
/obj/screen/movable/spell_master/genetic
name = "Mutant Powers"
icon_state = "genetic_spell_ready"
open_state = "genetics_open"
closed_state = "genetics_closed"
screen_loc = ui_genetic_master
//////////////ACTUAL SPELLS//////////////
//This is what you click to cast things//
/////////////////////////////////////////
/obj/screen/spell
icon = 'icons/mob/screen_spells.dmi'
icon_state = "wiz_spell_base"
var/spell_base = "wiz"
var/last_charge = 0 //not a time, but the last remembered charge value
var/spell/spell = null
var/handle_icon_updates = 0
var/icon/last_charged_icon
/obj/screen/spell/proc/update_charge(var/forced_update = 0)
if(!spell)
qdel(src)
return
if((last_charge == spell.charge_counter || !handle_icon_updates) && !forced_update)
return //nothing to see here
overlays -= spell.hud_state
if(spell.charge_type == Sp_RECHARGE || spell.charge_type == Sp_CHARGES)
if(spell.charge_counter < spell.charge_max)
icon_state = "[spell_base]_spell_base"
if(spell.charge_counter > 0)
var/icon/partial_charge = icon(src.icon, "[spell_base]_spell_ready")
partial_charge.Crop(1, 1, partial_charge.Width(), round(partial_charge.Height() * spell.charge_counter / spell.charge_max))
overlays += partial_charge
if(last_charged_icon)
overlays -= last_charged_icon
last_charged_icon = partial_charge
else if(last_charged_icon)
overlays -= last_charged_icon
last_charged_icon = null
else
icon_state = "[spell_base]_spell_ready"
if(last_charged_icon)
overlays -= last_charged_icon
else
icon_state = "[spell_base]_spell_ready"
overlays += spell.hud_state
last_charge = spell.charge_counter
overlays -= "silence"
if(spell.silenced)
overlays += "silence"
/obj/screen/spell/Click()
if(!usr || !spell)
qdel(src)
return
spell.perform(usr)
update_charge(1)
+1 -1
View File
@@ -20,7 +20,7 @@
return // seems legit.
// Things you might plausibly want to follow
if((ismob(A) && A != src) || istype(A,/obj/machinery/bot) || istype(A,/obj/machinery/singularity))
if((ismob(A) && A != src) || istype(A,/obj/machinery/bot) || istype(A,/obj/singularity))
ManualFollow(A)
// Otherwise jump
+1 -1
View File
@@ -253,7 +253,7 @@
See the previous More info, for... more info...
*/
//del(D)
//qdel(D)
// Garbage Collect Dummy
D.loc = null
D = null
+7 -7
View File
@@ -80,14 +80,14 @@ var/const/tk_maxrange = 15
if(focus.Adjacent(loc))
focus.loc = loc
del(src)
qdel(src)
return
//stops TK grabs being equipped anywhere but into hands
equipped(var/mob/user, var/slot)
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
del(src)
qdel(src)
return
@@ -99,10 +99,10 @@ var/const/tk_maxrange = 15
if(!target || !user) return
if(last_throw+3 > world.time) return
if(!host || host != user)
del(src)
qdel(src)
return
if(!(TK in host.mutations))
del(src)
qdel(src)
return
if(isobj(target) && !isturf(target.loc))
return
@@ -152,7 +152,7 @@ var/const/tk_maxrange = 15
proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored || !isturf(target.loc))
del src
qdel(src)
return
focus = target
update_icon()
@@ -162,7 +162,7 @@ var/const/tk_maxrange = 15
proc/apply_focus_overlay()
if(!focus) return
var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
var/obj/effect/overlay/O = PoolOrNew(/obj/effect/overlay, locate(focus.x,focus.y,focus.z))
O.name = "sparkles"
O.anchored = 1
O.density = 0
@@ -172,7 +172,7 @@ var/const/tk_maxrange = 15
O.icon_state = "nothing"
flick("empdisable",O)
spawn(5)
O.delete()
qdel(O)
return