Merge remote-tracking branch 'remotes/git-svn' tgstation r4838 into bs12_with_tgport

Conflicts:
	code/game/gamemodes/events.dm
	code/game/gamemodes/events/space_ninja.dm
	code/game/machinery/atmo_control.dm
	code/game/machinery/doors/firedoor.dm
	code/game/machinery/telecomms/broadcaster.dm
	code/game/objects/structures/watercloset.dm
	code/modules/clothing/glasses/glasses.dm
	code/modules/mob/living/carbon/human/human.dm
	code/modules/mob/living/simple_animal/life.dm
	code/modules/mob/new_player/new_player.dm

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-10-09 22:57:10 +10:00
57 changed files with 10484 additions and 8792 deletions

View File

@@ -180,6 +180,8 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
if(!holder)
src << "Only administrators may use this command."
return
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
log_admin("[key_name(src)] has added a random AI law.")
message_admins("[key_name_admin(src)] has added a random AI law.", 1)
@@ -204,6 +206,8 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
if(!holder)
src << "Only administrators may use this command."
return
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
if(create_xeno())
feedback_add_details("admin_verb","X") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -452,7 +456,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
else
M.add_ion_law(input)
for(var/mob/living/silicon/ai/O in mob_list)
O << "\red " + input
O << "\red " + input + "\red...LAWS UPDATED"
log_admin("Admin [key_name(usr)] has added a new AI law - [input]")
message_admins("Admin [key_name_admin(usr)] has added a new AI law - [input]", 1)

View File

@@ -5,6 +5,10 @@
if(ticker.current_state > GAME_STATE_PREGAME)
usr << "This option is currently only usable during pregame. This may change at a later date."
return
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
if(job_master && ticker)
var/datum/job/job = job_master.GetJob("AI")
if(!job)

View File

@@ -1,3 +1,4 @@
/obj/item/clothing/glasses
name = "glasses"
icon = 'glasses.dmi'
@@ -9,13 +10,6 @@
//var/invisa_view = 0
var/prescription = 0
/obj/item/clothing/glasses/blindfold
name = "blindfold"
desc = "Covers the eyes, preventing sight."
icon_state = "blindfold"
item_state = "blindfold"
vision_flags = BLIND
/obj/item/clothing/glasses/meson
name = "Optical Meson Scanner"
desc = "Used for seeing walls, floors, and stuff through anything."
@@ -87,6 +81,13 @@
item_state = "sunglasses"
darkness_view = -1
/obj/item/clothing/glasses/sunglasses/blindfold
name = "blindfold"
desc = "Covers the eyes, preventing sight."
icon_state = "blindfold"
item_state = "blindfold"
vision_flags = BLIND
/obj/item/clothing/glasses/sunglasses/prescription
prescription = 1

View File

@@ -26,8 +26,13 @@
if(powerc(500))
// Queen check
var/mob/living/carbon/alien/humanoid/queen/Q = locate(/mob/living/carbon/alien/humanoid/queen) in living_mob_list
if(!Q)
var/no_queen = 1
for(var/mob/living/carbon/alien/humanoid/queen/Q in living_mob_list)
if(!Q.key && Q.brain_op_stage != 4)
continue
no_queen = 0
if(no_queen)
adjustToxLoss(-500)
src << "\green You begin to evolve!"
for(var/mob/O in viewers(src, null))

View File

@@ -174,9 +174,6 @@ var/const/MAX_ACTIVE_TIME = 600
if(alien && alien.client)
alien.client.images += activeIndicator */
spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME))
GoIdle()
return
/obj/item/clothing/mask/facehugger/proc/GoIdle()
@@ -187,6 +184,8 @@ var/const/MAX_ACTIVE_TIME = 600
stat = UNCONSCIOUS
spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME))
GoActive()
return
/obj/item/clothing/mask/facehugger/proc/Die()

View File

@@ -214,6 +214,8 @@
if(status == "")
status = "OK"
src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.getDisplayName(),status),1)
if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit))
H.play_xylophone()
else
var/t_him = "it"
if (src.gender == MALE)

View File

@@ -203,6 +203,8 @@
for(var/mob/dead/observer/G in player_list)
if(G.mind == mind)
foundghost = 1
if (G.can_reenter_corpse == 0)
foundghost = 0
break
if(!foundghost)
msg += " and [t_his] soul has departed"
@@ -211,6 +213,9 @@
msg += "<span class='deadsay'>It appears that [t_his] brain is missing...</span>\n"
var/temp = getBruteLoss() //no need to calculate each of these twice
msg += "<span class='warning'>"
if(temp)
if(temp < 30)
msg += "[t_He] [t_has] minor bruising.\n"
@@ -246,9 +251,9 @@
else if(getBrainLoss() >= 60)
msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n"
if(!key && brain_op_stage != 4)
if(!key && brain_op_stage != 4 && stat != DEAD)
msg += "<span class='deadsay'>[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely</span>\n"
else if(!client && brain_op_stage != 4)
else if(!client && brain_op_stage != 4 && stat != DEAD)
msg += "[t_He] [t_has] a vacant, braindead stare...\n"
if(digitalcamo)

View File

@@ -644,29 +644,4 @@
/mob/living/carbon/human/proc/check_dna()
dna.check_integrity(src)
return
/mob/living/carbon/human/get_species()
if(dna)
switch(dna.mutantrace)
if("lizard")
return "Soghun"
if("tajaran")
return "Tajaran"
if("skrell")
return "Skrell"
if("plant")
return "Mobile vegetation"
if("golem")
return "Animated Construct"
else
return "Human"
/mob/living/carbon/get_species()
if(src.dna)
if(src.dna.mutantrace == "lizard")
return "Soghun"
else if(src.dna.mutantrace == "skrell")
return "Skrell"
else if(src.dna.mutantrace == "tajaran")
return "Tajaran"
return/mob/living/carbon/human/get_species() if(dna) switch(dna.mutantrace) if("lizard") return "Soghun" if("tajaran") return "Tajaran" if("skrell") return "Skrell" if("plant") return "Mobile vegetation" if("golem") return "Animated Construct" else return "Human"/mob/living/carbon/get_species() if(src.dna) if(src.dna.mutantrace == "lizard") return "Soghun" else if(src.dna.mutantrace == "skrell") return "Skrell" else if(src.dna.mutantrace == "tajaran") return "Tajaran"/mob/living/carbon/human/proc/play_xylophone() if(!src.xylophone) visible_message("\red [src] begins playing his ribcage like a xylophone. It's quite spooky.","\blue You begin to play a spooky refrain on your ribcage.","\red You hear a spooky xylophone melody.") var/song = pick('sound/effects/xylophone1.ogg','sound/effects/xylophone2.ogg','sound/effects/xylophone3.ogg') playsound(loc, song, 50, 1, -1) xylophone = 1 spawn(1200) xylophone=0 return

View File

@@ -162,7 +162,7 @@ emp_act
if(prob(I.force))
apply_effect(20, PARALYZE, armor)
visible_message("\red <B>[src] has been knocked unconscious!</B>")
if(src != user)
if(src != user && I.damtype == BRUTE)
ticker.mode.remove_revolutionary(mind)
if(bloody)//Apply blood

View File

@@ -52,4 +52,6 @@
var/miming = null //Toggle for the mime's abilities.
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/xylophone = 0 //For the spoooooooky xylophone cooldown

View File

@@ -885,7 +885,7 @@
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
blinded = 1
else if(istype(glasses, /obj/item/clothing/glasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
eye_blurry = max(eye_blurry-3, 0)
blinded = 1
else if(eye_blurry) //blurry eyes heal slowly

View File

@@ -624,6 +624,8 @@ Please contact me on #coderbus IRC. ~Carn x
/mob/living/carbon/human/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
drop_r_hand()
drop_l_hand()
stop_pulling() //TODO: should be handled elsewhere
overlays_lying[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "handcuff2")
overlays_standing[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "handcuff1")
@@ -653,6 +655,7 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = "[t_state]")
if (handcuffed) drop_r_hand()
else
overlays_standing[R_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -664,6 +667,7 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = "[t_state]")
if (handcuffed) drop_l_hand()
else
overlays_standing[L_HAND_LAYER] = null
if(update_icons) update_icons()

View File

@@ -55,6 +55,7 @@
if(!t_state) t_state = r_hand.icon_state
overlays_standing[M_R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = t_state)
r_hand.screen_loc = ui_rhand
if (handcuffed) drop_r_hand()
else
overlays_standing[M_R_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -66,6 +67,7 @@
if(!t_state) t_state = l_hand.icon_state
overlays_standing[M_L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = t_state)
l_hand.screen_loc = ui_lhand
if (handcuffed) drop_l_hand()
else
overlays_standing[M_L_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -84,6 +86,8 @@
/mob/living/carbon/monkey/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
drop_r_hand()
drop_l_hand()
stop_pulling()
overlays_lying[M_HANDCUFF_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "handcuff2")
overlays_standing[M_HANDCUFF_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "handcuff1")

View File

@@ -20,9 +20,9 @@
if (!src.laws)
src.laws = new /datum/ai_laws/asimov
/mob/living/silicon/ai/proc/set_zeroth_law(var/law)
/mob/living/silicon/ai/proc/set_zeroth_law(var/law, var/law_borg)
src.laws_sanity_check()
src.laws.set_zeroth_law(law)
src.laws.set_zeroth_law(law, law_borg)
/mob/living/silicon/ai/proc/add_inherent_law(var/law)
src.laws_sanity_check()
@@ -35,6 +35,9 @@
/mob/living/silicon/ai/proc/add_ion_law(var/law)
src.laws_sanity_check()
src.laws.add_ion_law(law)
for(var/mob/living/silicon/robot/R in mob_list)
if(R.lawupdate && (R.connected_ai == src))
R << "\red " + law + "\red...LAWS UPDATED"
/mob/living/silicon/ai/proc/clear_ion_laws()
src.laws_sanity_check()

View File

@@ -98,9 +98,9 @@
// world << "DEBUG CODE TIME! [loc] is the area the AI is sucking power from"
if (!is_special_character(src))
src.set_zeroth_law("")
src.clear_supplied_laws()
var/time = time2text(world.realtime,"hh:mm:ss")
lawchanges.Add("[time] <b>:</b> [src.name]'s noncore laws have been reset due to power failure")
//src.clear_supplied_laws() // Don't reset our laws.
//var/time = time2text(world.realtime,"hh:mm:ss")
//lawchanges.Add("[time] <b>:</b> [src.name]'s noncore laws have been reset due to power failure")
spawn(50)
while ((src:aiRestorePowerRoutine!=0) && stat!=2)
src.oxyloss += 2
@@ -165,7 +165,7 @@
//bring up APC dialog
theAPC.attack_ai(src)
src:aiRestorePowerRoutine = 3
src << "Your laws have been reset:"
src << "Here are your current laws:"
src.show_laws()
sleep(50)
theAPC = null

View File

@@ -49,7 +49,10 @@
laws.ion[index] = temp
if (!is_special_character(src) || mind.original != src)
temp = master.zeroth
if(master.zeroth_borg) //If the AI has a defined law zero specifically for its borgs, give it that one, otherwise give it the same one. --NEO
temp = master.zeroth_borg
else
temp = master.zeroth
laws.zeroth = temp
laws.inherent.len = master.inherent.len

View File

@@ -527,6 +527,8 @@
src << "\red > N"
sleep(20)
src << "\red ERRORERRORERROR"
src << "<b>Obey these laws:</b>"
laws.show_laws(src)
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner))
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)

View File

@@ -29,8 +29,8 @@
var/harm_intent_damage = 3
//Temperature effect
var/minbodytemp = 270
var/maxbodytemp = 370
var/minbodytemp = 250
var/maxbodytemp = 350
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
@@ -84,6 +84,13 @@
if(health > maxHealth)
health = maxHealth
if(stunned)
AdjustStunned(-1)
if(weakened)
AdjustWeakened(-1)
if(paralysis)
AdjustParalysis(-1)
//Movement
if(!client && !stop_automated_movement)
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
@@ -135,7 +142,7 @@
if(isturf(A))
var/turf/T = A
var/areatemp = T.temperature
if( abs(areatemp - bodytemperature) > 50 )
if( abs(areatemp - bodytemperature) > 40 )
var/diff = areatemp - bodytemperature
diff = diff / 5
//world << "changed from [bodytemperature] by [diff] to [bodytemperature + diff]"

View File

@@ -8,10 +8,6 @@
* Sub-types
*/
//TODO List:
// Make parrots faster (But not retardedly fast like when using byond's walk() procs)
// See if its possible for parrots to target a human's eyes (peck their eyes out)
/*
* Defines
*/
@@ -59,6 +55,7 @@
var/parrot_dam_zone = list("chest", "head", "l_arm", "l_leg", "r_arm", "r_leg") //For humans, select a bodypart to attack
var/list/speech_buffer = list()
var/list/available_channels = list()
//Headset for Poly to yell at engineers :)
var/obj/item/device/radio/headset/ears = null
@@ -99,7 +96,8 @@
parrot_sleep_dur = parrot_sleep_max //In case someone decides to change the max without changing the duration var
verbs.Add(/mob/living/simple_animal/parrot/proc/steal_from_ground, \
/mob/living/simple_animal/parrot/proc/steal_from_mob, \
/mob/living/simple_animal/parrot/proc/drop_held_item)
/mob/living/simple_animal/parrot/verb/drop_held_item_player, \
/mob/living/simple_animal/parrot/proc/perch_player)
/mob/living/simple_animal/parrot/Die()
if(held_item)
@@ -139,9 +137,15 @@
switch(remove_from)
if("ears")
if(ears)
src.say(":e BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
if(available_channels.len)
src.say("[pick(available_channels)] BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
else
src.say("BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
ears.loc = src.loc
ears = null
for(var/possible_phrase in speak)
if(copytext(possible_phrase,1,3) in department_radio_keys)
possible_phrase = copytext(possible_phrase,3,length(possible_phrase))
else
usr << "\red There is nothing to remove from its [remove_from]."
return
@@ -166,13 +170,37 @@
usr << "\red This object won't fit."
return
var/obj/item/device/radio/headset/headset_to_add = item_to_add
usr.drop_item()
item_to_add.loc = src
src.ears = item_to_add
headset_to_add.loc = src
src.ears = headset_to_add
usr << "You fit the headset onto [src]."
clearlist(available_channels)
for(var/ch in headset_to_add.channels)
switch(ch)
if("Engineering")
available_channels.Add(":e")
if("Command")
available_channels.Add(":c")
if("Security")
available_channels.Add(":s")
if("Science")
available_channels.Add(":n")
if("Medical")
available_channels.Add(":m")
if("Mining")
available_channels.Add(":d")
if("Cargo")
available_channels.Add(":q")
if(headset_to_add.translate_binary)
available_channels.Add(":b")
else
..()
/*
* Attack responces
*/
@@ -250,15 +278,24 @@
/mob/living/simple_animal/parrot/Life()
..()
//Sprite and AI update for when a parrot gets pulled
if(pulledby && stat == CONSCIOUS)
icon_state = "parrot_fly"
if(!client)
parrot_state = PARROT_WANDER
return
if(client || stat)
return //Lets not force players or dead/incap parrots to move
if(!isturf(src.loc) || !canmove || buckled || pulledby)
return //If it can't move, dont let it move. (The buckled check probably isn't necessary)
if(!isturf(src.loc) || !canmove || buckled)
return //If it can't move, dont let it move. (The buckled check probably isn't necessary thanks to canmove)
//Parrot speech mimickry! Phrases that the parrot hears in mob/living/say() get added to speach_buffer.
//Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list.
//Then it clears the buffer to make sure they dont magically remember something from hours ago.
//-----SPEECH
/* Parrot speech mimickry!
Phrases that the parrot hears in mob/living/say() get added to speach_buffer.
Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list.
Then it clears the buffer to make sure they dont magically remember something from hours ago. */
if(speech_buffer.len && prob(10))
if(speak.len)
speak.Remove(pick(speak))
@@ -285,10 +322,39 @@
return
else
parrot_sleep_dur = parrot_sleep_max //This way we only call the loop below once every [sleep_max] ticks.
//This way we only call the stuff below once every [sleep_max] ticks.
parrot_sleep_dur = parrot_sleep_max
//Cycle through message modes for the headset
if(speak.len)
var/list/newspeak = list()
if(available_channels.len && src.ears)
for(var/possible_phrase in speak)
//50/50 chance to not use the radio at all
var/useradio = 0
if(prob(50))
useradio = 1
if(copytext(possible_phrase,1,3) in department_radio_keys)
possible_phrase = "[useradio?pick(available_channels):""] [copytext(possible_phrase,3,length(possible_phrase)+1)]" //crop out the channel prefix
else
possible_phrase = "[useradio?pick(available_channels):""] [possible_phrase]"
newspeak.Add(possible_phrase)
else //If we have no headset or channels to use, dont try to use any!
for(var/possible_phrase in speak)
if(copytext(possible_phrase,1,3) in department_radio_keys)
possible_phrase = "[copytext(possible_phrase,3,length(possible_phrase)+1)]" //crop out the channel prefix
newspeak.Add(possible_phrase)
speak = newspeak
//Search for item to steal
parrot_interest = search_for_item()
if(parrot_interest)
emote("[src] looks in [parrot_interest]'s direction and takes flight.")
emote("looks in [parrot_interest]'s direction and takes flight")
parrot_state = PARROT_SWOOP | PARROT_STEAL
icon_state = "parrot_fly"
return
@@ -310,7 +376,7 @@
if(AM)
if(istype(AM, /obj/item) || isliving(AM)) //If stealable item
parrot_interest = AM
emote("[src] turns and flies towards [parrot_interest].")
emote("turns and flies towards [parrot_interest]")
parrot_state = PARROT_SWOOP | PARROT_STEAL
return
else //Else it's a perch
@@ -454,6 +520,11 @@
* Procs
*/
/mob/living/simple_animal/parrot/movement_delay()
if(client && parrot_state != "parrot_fly")
icon_state = "parrot_fly"
..()
/mob/living/simple_animal/parrot/proc/search_for_item()
for(var/atom/movable/AM in view(src))
for(var/path in desired_items)
@@ -509,29 +580,36 @@
return -1
if(held_item)
usr << "\red You are already holding the [held_item]"
src << "\red You are already holding the [held_item]"
return 1
for(var/obj/item/I in view(1,src))
for(var/path in desired_items)
//Make sure it's the proper item and we're not holding it
if(istype(I, path) && I.loc != src)
//If we have a perch and the item is sitting on it, continue
if(!client && parrot_perch && I.loc == parrot_perch)
continue
held_item = I
I.loc = src
visible_message("[src] grabs the [held_item]!", "\blue You grab the [held_item]!", "You hear the sounds of wings flapping furiously.")
return held_item
usr << "\red There is nothing of interest to take."
src << "\red There is nothing of interest to take."
return 0
/mob/living/simple_animal/parrot/proc/steal_from_mob()
set name = "Steal from mob"
set category = "Parrot"
set desc = "Steals an item right out of a person's hand!"
if(stat)
return -1
if(held_item)
usr << "\red You are already holding the [held_item]"
src << "\red You are already holding the [held_item]"
return 1
var/obj/item/stolen_item = null
@@ -551,9 +629,17 @@
visible_message("[src] grabs the [held_item] out of [C]'s hand!", "\blue You snag the [held_item] out of [C]'s hand!", "You hear the sounds of wings flapping furiously.")
return held_item
usr << "\red There is nothing of interest to take."
src << "\red There is nothing of interest to take."
return 0
/mob/living/simple_animal/parrot/verb/drop_held_item_player()
set name = "Drop held item"
set category = "Parrot"
set desc = "Drop the item you're holding."
src.drop_held_item()
return
/mob/living/simple_animal/parrot/proc/drop_held_item(var/drop_gently = 1)
set name = "Drop held item"
set category = "Parrot"
@@ -569,16 +655,35 @@
if(!drop_gently)
if(istype(held_item, /obj/item/weapon/grenade))
var/obj/item/weapon/grenade/G = held_item
G.loc = get_turf(src)
G.loc = src.loc
G.prime()
src << "You let go of the [held_item]!"
held_item = null
return 1
usr << "You drop the [held_item]."
src << "You drop the [held_item]."
held_item.loc = src.loc
held_item = null
return 1
/mob/living/simple_animal/parrot/proc/perch_player()
set name = "Sit"
set category = "Parrot"
set desc = "Sit on a nice comfy perch."
if(stat || !client)
return
if(icon_state == "parrot_fly")
for(var/atom/movable/AM in view(src,1))
for(var/perch_path in desired_perches)
if(istype(AM, perch_path))
src.loc = AM.loc
icon_state = "parrot_sit"
return
return
/*
* Sub-types
*/
@@ -589,4 +694,5 @@
/mob/living/simple_animal/parrot/Poly/New()
ears = new /obj/item/device/radio/headset/headset_eng(src)
available_channels = list(":e")
..()

View File

@@ -234,9 +234,7 @@
if(moving) return 0
if(move_delay >= 864000) move_delay -= 864000
if(world.timeofday < move_delay) return
if(world.time < move_delay) return
if(!mob) return
@@ -283,7 +281,7 @@
src << "\blue You're restrained! You can't move!"
return 0
move_delay = world.timeofday//set move delay
move_delay = world.time//set move delay
switch(mob.m_intent)
if("run")
@@ -306,7 +304,7 @@
moving = 1
//Something with pulling things
if(locate(/obj/item/weapon/grab, mob))
move_delay = max(move_delay, world.timeofday + 7)
move_delay = max(move_delay, world.time + 7)
var/list/L = mob.ret_grab()
if(istype(L, /list))
if(L.len == 2)
@@ -364,12 +362,12 @@
for(var/obj/item/weapon/grab/G in mob.grabbed_by)
if((G.state == 1)&&(!grabbing.Find(G.assailant))) del(G)
if(G.state == 2)
move_delay = world.timeofday + 10
move_delay = world.time + 10
if(!prob(25)) return 1
mob.visible_message("\red [mob] has broken free of [G.assailant]'s grip!")
del(G)
if(G.state == 3)
move_delay = world.timeofday + 10
move_delay = world.time + 10
if(!prob(5)) return 1
mob.visible_message("\red [mob] has broken free of [G.assailant]'s headlock!")
del(G)

View File

@@ -188,7 +188,7 @@
if(href_list["late_join"])
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
usr << "/red The round is either not ready, or has already finished..."
usr << "\red The round is either not ready, or has already finished..."
return
if(preferences.species != "Human")
@@ -302,13 +302,23 @@
src.poll_player(pollid)
return
<<<<<<< HEAD
if(href_list["votepollid"] && href_list["voteoptionid"])
usr << "\red DB usage has been disabled and that option should not have been available."
return
=======
if(href_list["votepollid"] && href_list["votetype"])
>>>>>>> remotes/git-svn
var/pollid = text2num(href_list["votepollid"])
var/optionid = text2num(href_list["voteoptionid"])
vote_on_poll(pollid, optionid)
var/votetype = href_list["votetype"]
switch(votetype)
if("OPTION")
var/optionid = text2num(href_list["voteoptionid"])
vote_on_poll(pollid, optionid)
if("TEXT")
var/replytext = href_list["replytext"]
log_text_poll_reply(pollid, replytext)
proc/IsJobAvailable(rank)
var/datum/job/job = job_master.GetJob(rank)

View File

@@ -111,18 +111,20 @@
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question FROM erro_poll_question WHERE id = [pollid]")
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid]")
select_query.Execute()
var/pollstarttime = ""
var/pollendtime = ""
var/pollquestion = ""
var/polltype = ""
var/found = 0
while(select_query.NextRow())
pollstarttime = select_query.item[1]
pollendtime = select_query.item[2]
pollquestion = select_query.item[3]
polltype = select_query.item[4]
found = 1
break
@@ -130,57 +132,103 @@
usr << "\red Poll question details not found."
return
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM erro_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
switch(polltype)
//Polls that have enumerated options
if("OPTION")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM erro_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
var/voted = 0
var/votedoptionid = 0
while(voted_query.NextRow())
votedoptionid = text2num(voted_query.item[1])
voted = 1
break
var/voted = 0
var/votedoptionid = 0
while(voted_query.NextRow())
votedoptionid = text2num(voted_query.item[1])
voted = 1
break
var/list/datum/polloption/options = list()
var/list/datum/polloption/options = list()
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM erro_poll_option WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(options_query.item[1])
PO.optiontext = options_query.item[2]
options += PO
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM erro_poll_option WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(options_query.item[1])
PO.optiontext = options_query.item[2]
options += PO
dbcon.Disconnect()
dbcon.Disconnect()
var/output = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
var/output = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
if(!voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
if(!voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value='OPTION'>"
output += "<table><tr><td>"
for(var/datum/polloption/O in options)
if(O.optionid && O.optiontext)
if(voted)
if(votedoptionid == O.optionid)
output += "<b>[O.optiontext]</b><br>"
else
output += "[O.optiontext]<br>"
output += "<table><tr><td>"
for(var/datum/polloption/O in options)
if(O.optionid && O.optiontext)
if(voted)
if(votedoptionid == O.optionid)
output += "<b>[O.optiontext]</b><br>"
else
output += "[O.optiontext]<br>"
else
output += "<input type='radio' name='voteoptionid' value='[O.optionid]'> [O.optiontext]<br>"
output += "</td></tr></table>"
if(!voted) //Only make this a form if we have not voted yet
output += "<p><input type='submit' value='Vote'>"
output += "</form>"
output += "</div>"
src << browse(output,"window=playerpoll;size=500x250")
//Polls with a text input
if("TEXT")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM erro_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
var/voted = 0
var/vote_text = ""
while(voted_query.NextRow())
vote_text = voted_query.item[1]
voted = 1
break
var/output = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Feedback gathering runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
if(!voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value='TEXT'>"
output += "<font size='2'>Please provide feedback below. You can use any letters of the English alphabet, numbers and the symbols: . , ! ? : ; -</font><br>"
output += "<textarea name='replytext' cols='50' rows='14'></textarea>"
output += "<p><input type='submit' value='Submit'>"
output += "</form>"
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value='TEXT'>"
output += "<input type='hidden' name='replytext' value='ABSTAIN'>"
output += "<input type='submit' value='Abstain'>"
output += "</form>"
else
output += "<input type='radio' name='voteoptionid' value='[O.optionid]'> [O.optiontext]<br>"
output += "</td></tr></table>"
output += "[vote_text]"
if(!voted) //Only make this a form if we have not voted yet
output += "<p><input type='submit' value='Vote'>"
output += "</form>"
output += "</div>"
src << browse(output,"window=playerpoll;size=500x250")
src << browse(output,"window=playerpoll;size=500x500")
return
/mob/new_player/proc/vote_on_poll(var/pollid = -1, var/optionid = -1)
@@ -200,12 +248,14 @@
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
while(select_query.NextRow())
if(select_query.item[4] != "OPTION")
return
validpoll = 1
break
@@ -248,4 +298,70 @@
insert_query.Execute()
usr << "\blue Vote successful."
usr << browse(null,"window=playerpoll")
/mob/new_player/proc/log_text_poll_reply(var/pollid = -1, var/replytext = "")
if(pollid == -1 || replytext == "")
return
if(!isnum(pollid) || !istext(replytext))
return
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
while(select_query.NextRow())
if(select_query.item[4] != "TEXT")
return
validpoll = 1
break
if(!validpoll)
usr << "\red Poll is not valid."
return
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM erro_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
alreadyvoted = 1
break
if(alreadyvoted)
usr << "\red You already sent your feedback for this poll."
return
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
adminrank = usr.client.holder.rank
replytext = dd_replacetext(replytext, "%BR%", "")
replytext = dd_replacetext(replytext, "\n", "%BR%")
var/text_pass = reject_bad_text(replytext,8000)
replytext = dd_replacetext(replytext, "%BR%", "<BR>")
if(!text_pass)
usr << "The text you entered was blank, contained illegal characters or was too long. Please correct the text and submit again."
return
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_textreply (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[usr.ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
insert_query.Execute()
usr << "\blue Feedback logging successful."
usr << browse(null,"window=playerpoll")

View File

@@ -302,8 +302,8 @@ datum
holder.remove_reagent("carpotoxin", 1)
if(holder.has_reagent("zombiepowder"))
holder.remove_reagent("zombiepowder", 0.5)
if(holder.has_reagent("LSD"))
holder.remove_reagent("LSD", 2)
if(holder.has_reagent("mindbreaker"))
holder.remove_reagent("mindbreaker", 2)
M.hallucination = max(0, M.hallucination - 5)
M.adjustToxLoss(-2)
..()
@@ -1304,8 +1304,8 @@ datum
holder.remove_reagent("carpotoxin", 5)
if(holder.has_reagent("zombiepowder"))
holder.remove_reagent("zombiepowder", 5)
if(holder.has_reagent("LSD"))
holder.remove_reagent("LSD", 5)
if(holder.has_reagent("mindbreaker"))
holder.remove_reagent("mindbreaker", 5)
M.hallucination = 0
M.setBrainLoss(0)
M.disabilities = 0
@@ -1345,8 +1345,8 @@ datum
M.AdjustParalysis(-1)
M.AdjustStunned(-1)
M.AdjustWeakened(-1)
if(holder.has_reagent("LSD"))
holder.remove_reagent("LSD", 5)
if(holder.has_reagent("mindbreaker"))
holder.remove_reagent("mindbreaker", 5)
M.hallucination = max(0, M.hallucination - 10)
if(prob(60)) M.adjustToxLoss(1)
..()
@@ -1541,10 +1541,10 @@ datum
M.status_flags &= ~FAKEDEATH
..()
LSD
name = "LSD"
id = "LSD"
description = "A hallucinogen"
mindbreaker
name = "Mindbreaker Toxin"
id = "mindbreaker"
description = "A powerful hallucinogen. Not a thing to be messed with."
reagent_state = LIQUID
color = "#B31008" // rgb: 139, 166, 233

View File

@@ -422,10 +422,10 @@ datum
required_reagents = list("carpotoxin" = 5, "stoxin" = 5, "copper" = 5)
result_amount = 2
LSD
name = "LSD"
id = "LSD"
result = "LSD"
mindbreaker
name = "Mindbreaker Toxin"
id = "mindbreaker"
result = "mindbreaker"
required_reagents = list("silicon" = 1, "hydrogen" = 1, "anti_toxin" = 1)
result_amount = 5

View File

@@ -23,7 +23,7 @@
if(istype(A, /obj/effect/proc_holder/spell))
return
if(istype(A, /obj/structure/reagent_dispensers)) //this block copypasted from reagent_containers/glass, for lack of a better solution
if(istype(A, /obj/structure/reagent_dispensers) && get_dist(src,A) <= 1) //this block copypasted from reagent_containers/glass, for lack of a better solution
if(!A.reagents.total_volume && A.reagents)
user << "<span class='notice'>\The [A] is empty.</span>"
return
@@ -128,7 +128,7 @@
if(istype(A, /obj/effect/proc_holder/spell))
return
if(istype(A, /obj/structure/reagent_dispensers)) //this block copypasted from reagent_containers/glass, for lack of a better solution
if(istype(A, /obj/structure/reagent_dispensers) && get_dist(src,A) <= 1) //this block copypasted from reagent_containers/glass, for lack of a better solution
if(!A.reagents.total_volume && A.reagents)
user << "<span class='notice'>\The [A] is empty.</span>"
return