mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
FullofSkittles Custom pAI & Silicon Fluff Tweaks
Adds in FullofSkittles's custom pAI Adds support for custom pAI sprites Tweaks code for custom cyborg, AI, and hologram sprites to be more standardized, which made adding pAI support that much easier. I guess this could also be extended later on if we wanted to support custom maint drone sprites... As a result of the changes, the custom_sprites.txt file will need to be updated to the new standardized format (been working with Alffd on that anyways so he's aware). I have taken the liberty of updating the example custom_sprites.txt to explain and match this new format for our downstreams and other coders. 🆑 rscadd: Adds FullofSkittles's custom pAI sprites. Thanks FoS! /🆑
This commit is contained in:
@@ -299,11 +299,11 @@ var/list/ai_verbs_default = list(
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2)
|
||||
continue
|
||||
if(Entry.len < 3 || Entry[1] != "ai") //ignore incorrectly formatted entries or entries that aren't marked for AI
|
||||
continue;
|
||||
|
||||
if(Entry.len < 3 && Entry[1] == ckey && Entry[2] == real_name)
|
||||
custom_sprite = 1 //They're in the list? Custom sprite time
|
||||
if(Entry[2] == ckey && Entry[3] == real_name) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
icon = 'icons/mob/custom-synthetic.dmi'
|
||||
|
||||
|
||||
@@ -859,10 +859,10 @@ var/list/ai_verbs_default = list(
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 3)
|
||||
if(Entry.len < 3 || Entry[1] != "hologram")
|
||||
continue
|
||||
|
||||
if (Entry[1] == ckey && Entry[2] == real_name && Entry[3] == "Hologram") //Custom holograms
|
||||
if (Entry[2] == ckey && Entry[3] == real_name) //Custom holograms
|
||||
custom_hologram = 1 // option is given in hologram menu
|
||||
|
||||
var/input
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
var/translator_on = 0 // keeps track of the translator module
|
||||
|
||||
var/current_pda_messaging = null
|
||||
var/custom_sprite = 0
|
||||
|
||||
/mob/living/silicon/pai/New(var/obj/item/device/paicard)
|
||||
loc = paicard
|
||||
@@ -396,15 +397,38 @@
|
||||
|
||||
var/choice
|
||||
var/finalized = "No"
|
||||
while(finalized == "No" && client)
|
||||
|
||||
choice = input(usr,"What would you like to use for your mobile chassis icon? This decision can only be made once.") as null|anything in possible_chassis
|
||||
if(!choice) return
|
||||
//check for custom_sprite
|
||||
if(!custom_sprite)
|
||||
var/file = file2text("config/custom_sprites.txt")
|
||||
var/lines = splittext(file, "\n")
|
||||
|
||||
icon_state = possible_chassis[choice]
|
||||
finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes")
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = splittext(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
chassis = possible_chassis[choice]
|
||||
if(Entry.len < 3 || Entry[1] != "pai") //ignore incorrectly formatted entries or entries that aren't marked for pAI
|
||||
continue;
|
||||
|
||||
if(Entry[2] == ckey && Entry[3] == real_name) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
icon = 'icons/mob/custom-synthetic.dmi'
|
||||
|
||||
if(custom_sprite)
|
||||
chassis = "[ckey]-pai"
|
||||
icon_state = "[ckey]-pai"
|
||||
else
|
||||
while(finalized == "No" && client)
|
||||
|
||||
choice = input(usr,"What would you like to use for your mobile chassis icon? This decision can only be made once.") as null|anything in possible_chassis
|
||||
if(!choice) return
|
||||
|
||||
icon_state = possible_chassis[choice]
|
||||
finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes")
|
||||
|
||||
chassis = possible_chassis[choice]
|
||||
verbs -= /mob/living/silicon/pai/proc/choose_chassis
|
||||
|
||||
/mob/living/silicon/pai/proc/choose_verbs()
|
||||
@@ -569,8 +593,15 @@
|
||||
if(resting)
|
||||
icon_state = "[chassis]"
|
||||
resting = 0
|
||||
H.icon_state = "pai-[icon_state]"
|
||||
H.item_state = "pai-[icon_state]"
|
||||
if(custom_sprite)
|
||||
H.icon_override = 'icons/mob/custom-synthetic.dmi'
|
||||
H.lefthand_file = 'icons/mob/custom-synthetic.dmi' //unless we want to make a new file for the left and right in-hands for custom pAIs...
|
||||
H.righthand_file = 'icons/mob/custom-synthetic.dmi' //you'll want to just use one in-hand sprite that looks the same in both hands. --FalseIncarnate
|
||||
H.icon_state = "[icon_state]_head"
|
||||
H.item_state = "[icon_state]_hand"
|
||||
else
|
||||
H.icon_state = "pai-[icon_state]"
|
||||
H.item_state = "pai-[icon_state]"
|
||||
grabber.put_in_active_hand(H)//for some reason unless i call this it dosen't work
|
||||
grabber.update_inv_l_hand()
|
||||
grabber.update_inv_r_hand()
|
||||
|
||||
@@ -180,14 +180,14 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
for(var/line in lines)
|
||||
// split & clean up
|
||||
var/list/Entry = splittext(line, ";")
|
||||
var/list/Entry = splittext(line, ":")
|
||||
for(var/i = 1 to Entry.len)
|
||||
Entry[i] = trim(Entry[i])
|
||||
|
||||
if(Entry.len < 2)
|
||||
if(Entry.len < 3 || Entry[1] != "cyborg") //ignore incorrectly formatted entries or entries that aren't marked for cyborg
|
||||
continue;
|
||||
|
||||
if(Entry[1] == src.ckey && Entry[2] == src.real_name) //They're in the list? Custom sprite time, var and icon change required
|
||||
if(Entry[2] == ckey && Entry[3] == real_name) //They're in the list? Custom sprite time, var and icon change required
|
||||
custom_sprite = 1
|
||||
icon = 'icons/mob/custom-synthetic.dmi'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user