Files
fulpstation/code/modules/ninja/suit/mask.dm
Bjorn Neergaard 063dd9fb84 Get the code running on 510
* Travis for 510
* Remove json, list2text, text2list, bygex
* Change blind and click catcher to a low plane
2016-02-04 17:19:40 -06:00

140 lines
5.4 KiB
Plaintext

/*
Contents:
- The Ninja Space Mask
- Ninja Space Mask speech modification
*/
/obj/item/clothing/mask/gas/voice/space_ninja
name = "ninja mask"
desc = "A close-fitting mask that acts both as an air filter and a post-modern fashion statement."
icon_state = "s-ninja"
item_state = "s-ninja_mask"
vchange = 1
strip_delay = 120
/obj/item/clothing/mask/gas/voice/space_ninja/speechModification(message)
if(voice == "Unknown")
if(copytext(message, 1, 2) != "*")
var/list/temp_message = splittext(message, " ")
var/list/pick_list = list()
for(var/i = 1, i <= temp_message.len, i++)
pick_list += i
for(var/i=1, i <= abs(temp_message.len/3), i++)
var/H = pick(pick_list)
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
temp_message[H] = ninjaspeak(temp_message[H])
pick_list -= H
message = jointext(temp_message, " ")
//The Alternate speech mod is now the main one.
message = replacetext(message, "l", "r")
message = replacetext(message, "rr", "ru")
message = replacetext(message, "v", "b")
message = replacetext(message, "f", "hu")
message = replacetext(message, "'t", "")
message = replacetext(message, "t ", "to ")
message = replacetext(message, " I ", " ai ")
message = replacetext(message, "th", "z")
message = replacetext(message, "is", "izu")
message = replacetext(message, "ziz", "zis")
message = replacetext(message, "se", "su")
message = replacetext(message, "br", "bur")
message = replacetext(message, "ry", "ri")
message = replacetext(message, "you", "yuu")
message = replacetext(message, "ck", "cku")
message = replacetext(message, "eu", "uu")
message = replacetext(message, "ow", "au")
message = replacetext(message, "are", "aa")
message = replacetext(message, "ay", "ayu")
message = replacetext(message, "ea", "ii")
message = replacetext(message, "ch", "chi")
message = replacetext(message, "than", "sen")
message = replacetext(message, ".", "")
message = lowertext(message)
return message
/obj/item/clothing/mask/gas/voice/space_ninja/New()
verbs += /obj/item/clothing/mask/gas/voice/space_ninja/proc/togglev
//This proc is linked to human life.dm. It determines what hud icons to display based on mind special role for most mobs.
/obj/item/clothing/mask/gas/voice/space_ninja/proc/assess_targets(list/target_list, mob/living/carbon/U)
var/icon/tempHud = 'icons/mob/hud.dmi'
for(var/mob/living/target in target_list)
if(iscarbon(target))
switch(target.mind.special_role)
if("traitor")
U.client.images += image(tempHud,target,"hudtraitor")
if("Revolutionary","Head Revolutionary")
U.client.images += image(tempHud,target,"hudrevolutionary")
if("Cultist")
U.client.images += image(tempHud,target,"hudcultist")
if("Changeling")
U.client.images += image(tempHud,target,"hudchangeling")
if("Wizard","Fake Wizard")
U.client.images += image(tempHud,target,"hudwizard")
if("Hunter","Sentinel","Drone","Queen")
U.client.images += image(tempHud,target,"hudalien")
if("Syndicate")
U.client.images += image(tempHud,target,"hudoperative")
if("Death Commando")
U.client.images += image(tempHud,target,"huddeathsquad")
if("Space Ninja")
U.client.images += image(tempHud,target,"hudninja")
else//If we don't know what role they have but they have one.
U.client.images += image(tempHud,target,"hudunknown1")
else if(issilicon(target))//If the silicon mob has no law datum, no inherent laws, or a law zero, add them to the hud.
var/mob/living/silicon/silicon_target = target
if(!silicon_target.laws||(silicon_target.laws&&(silicon_target.laws.zeroth||!silicon_target.laws.inherent.len)))
if(isrobot(silicon_target))//Different icons for robutts and AI.
U.client.images += image(tempHud,silicon_target,"hudmalborg")
else
U.client.images += image(tempHud,silicon_target,"hudmalai")
return 1
/obj/item/clothing/mask/gas/voice/space_ninja/proc/togglev()
set name = "Toggle Voice"
set desc = "Toggles the voice synthesizer on or off."
set category = "Ninja Equip"
var/mob/U = loc//Can't toggle voice when you're not wearing the mask.
var/vchange = (alert("Would you like to synthesize a new name or turn off the voice synthesizer?",,"New Name","Turn Off"))
if(vchange == "New Name")
var/chance = rand(1,100)
switch(chance)
if(1 to 50)//High chance of a regular name.
voice = "[rand(0,1) == 1 ? pick(first_names_female) : pick(first_names_male)] [pick(last_names)]"
if(51 to 70)//Smaller chance of a lizard name.
voice = "[pick(lizard_name(MALE),lizard_name(FEMALE))]"
if(71 to 80)//Small chance of a clown name.
voice = "[pick(clown_names)]"
if(81 to 90)//Small chance of a wizard name.
voice = "[pick(wizard_first)] [pick(wizard_second)]"
if(91 to 100)//Small chance of an existing crew name.
var/list/names = list()
for(var/mob/living/carbon/human/M in player_list)
if(M == U || !M.client || !M.real_name)
continue
names.Add(M.real_name)
voice = !names.len ? "Cuban Pete" : pick(names)
U << "You are now mimicking <B>[voice]</B>."
else
U << "The voice synthesizer is [voice!="Unknown"?"now":"already"] deactivated."
voice = "Unknown"
return
/obj/item/clothing/mask/gas/voice/space_ninja/examine(mob/user)
..()
user << "Voice mimicking algorithm is set <B>[!vchange?"inactive":"active"]</B>."