Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Больше возможностей щитспавна для адменов #8115

Merged
merged 10 commits into from
Nov 6, 2021
2 changes: 2 additions & 0 deletions code/__DEFINES/gamemodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define F_FAMILIES "Families"
#define F_HEIST "Vox Shoal"
#define F_HIVEMIND "Changeling Hivemind"
#define F_PROPS "Props"
#define F_REVOLUTION "Revolution"
#define F_SYNDIOPS "Syndicate Operatives"
#define F_SYNDIESQUAD "Syndicate Elite Strike Team"
Expand Down Expand Up @@ -41,6 +42,7 @@
#define NUKE_OP "Nuclear Operative"
#define NUKE_OP_LEADER "Nuclear Operative Leader"
#define NINJA "Space Ninja"
#define PROP "Prop"
#define REV "Revolutionary"
#define RESPONDER "Emergency Responder"
#define SHADOW "Shadowling"
Expand Down
14 changes: 14 additions & 0 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -698,3 +698,17 @@

/mob/proc/transfer_personality(client/C)
return

/atom/proc/has_valid_appearance()
if(!check_sprite())
return FALSE
if(alpha != 255)
return FALSE
if(invisibility != 0)
return FALSE
return TRUE

/atom/proc/check_sprite()
if(icon_state in icon_states(icon))
return TRUE
return FALSE
9 changes: 9 additions & 0 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -740,3 +740,12 @@
..()
mind.assigned_role = "Armalis"
mind.special_role = "Vox Raider"

/mob/living/simple_animal/hostile/mimic/prophunt/mind_initialize()
..()

var/datum/faction/infestation/I = find_faction_by_type(/datum/faction/props)
if(!I)
I = SSticker.mode.CreateFaction(/datum/faction/props)
I.forgeObjectives()
add_faction_member(I, src, TRUE)
25 changes: 25 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,28 @@

/atom/movable/proc/update_size_class()
return w_class

/client/var/list/image/outlined_item = list()
/atom/movable/proc/apply_outline(color)
if(anchored || !usr.client.prefs.outline_enabled)
return
if(!color)
color = usr.client.prefs.outline_color || COLOR_BLUE_LIGHT
if(usr.client.outlined_item[src])
return

if(usr.client.outlined_item.len)
remove_outline()

var/image/IMG = image(null, src, layer = layer, pixel_x = -pixel_x, pixel_y = -pixel_y)
IMG.appearance_flags |= KEEP_TOGETHER | RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM
IMG.vis_contents += src

IMG.filters += filter(type = "outline", size = 1, color = color)
usr.client.images |= IMG
usr.client.outlined_item[src] = IMG


/atom/movable/proc/remove_outline()
usr.client.images -= usr.client.outlined_item[src]
usr.client.outlined_item -= src
34 changes: 34 additions & 0 deletions code/game/gamemodes/factions/props.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/datum/faction/props
name = F_PROPS
ID = F_PROPS

roletype = /datum/role/prop

logo_state = "change-logoa"

var/points = 0

/datum/faction/props/GetFactionHeader()
var/icon/logo_left = get_logo_icon("change-logoa")
var/icon/logo_right = get_logo_icon("change-logob")
var/header = {"[bicon(logo_left, css = "style='position:relative; top:10px;'")] <FONT size = 2><B>[capitalize(name)]</B></FONT> [bicon(logo_right, css = "style='position:relative; top:10px;'")]"}
return header

/datum/faction/props/forgeObjectives()
if(!..())
return FALSE
AppendObjective(/datum/objective/prop/points)

/datum/faction/props/GetScoreboard()
. = ..()
. += "Очки: [round(points)]"

/datum/faction/props/AdminPanelEntry()
. = ..()
. += "<br>Очки: [points]"

/datum/faction/props/process()
. = ..()
for(var/datum/role/R in members)
if(R.antag?.current)
points += 1
9 changes: 9 additions & 0 deletions code/game/gamemodes/objectives/prop_points.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/datum/objective/prop/points
explanation_text = "Накопите 5000 очков"
var/need_points = 5000

/datum/objective/prop/points/check_completion()
var/datum/faction/props/P = faction
if(!istype(P))
return OBJECTIVE_LOSS
return P.points > need_points
12 changes: 12 additions & 0 deletions code/game/gamemodes/roles/prop.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/datum/role/prop
name = PROP
id = PROP
disallow_job = TRUE

logo_state = "change-logoa"

/datum/role/prop/Greet(greeting, custom)
. = ..()
to_chat(antag.current, "Вы - аморфное существо, которое способно превращаться в любой предмет.")
to_chat(antag.current, "Пользуйтесь этим, чтобы выполнить цели.")
to_chat(antag.current, "Чтобы превратиться в предмет выберите Help-intent, а чтобы бить любой другой.")
26 changes: 0 additions & 26 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1023,29 +1023,3 @@
. = ..()
if(src != over)
remove_outline()


/client/var/list/image/outlined_item = list()
/obj/item/proc/apply_outline(color)
if(anchored || !usr.client.prefs.outline_enabled)
return
if(!color)
color = usr.client.prefs.outline_color || COLOR_BLUE_LIGHT
if(usr.client.outlined_item[src])
return

if(usr.client.outlined_item.len)
remove_outline()

var/image/IMG = image(null, src, layer = layer, pixel_x = -pixel_x, pixel_y = -pixel_y)
IMG.appearance_flags |= KEEP_TOGETHER | RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM
IMG.vis_contents += src

IMG.filters += filter(type = "outline", size = 1, color = color)
usr.client.images |= IMG
usr.client.outlined_item[src] = IMG


/obj/item/proc/remove_outline()
usr.client.images -= usr.client.outlined_item[src]
usr.client.outlined_item -= src
11 changes: 1 addition & 10 deletions code/game/objects/items/devices/chameleonproj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@
/obj/item/device/chameleon/afterattack(atom/target, mob/user, proximity, params)
if(!proximity)
return
if(!check_sprite(target))
return
if(target.alpha != 255)
return
if(target.invisibility != 0)
if(!target.has_valid_appearance())
return
if(!active_dummy)
active_dummy = new
Expand All @@ -83,11 +79,6 @@
else
to_chat(user, "<span class='notice'>\The [target] already scanned.</span>")

/obj/item/device/chameleon/proc/check_sprite(atom/target)
if(target.icon_state in icon_states(target.icon))
return TRUE
return FALSE

/obj/item/device/chameleon/proc/copy_item(obj/O)
var/obj/effect/dummy/chameleon/C = active_dummy
C.name = O.name
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/simple_animal/hostile/hostile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
walk(src, 0)
return 0
if(client)
if(target)
LoseTarget()
return 0

if(!stat)
Expand Down
104 changes: 99 additions & 5 deletions code/modules/mob/living/simple_animal/hostile/mimic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
if(.)
emote("growls at [.]")

/mob/living/simple_animal/hostile/mimic/death()
..()
visible_message("<span class='warning'><b>[src]</b> stops moving!</span>")
qdel(src)



//
Expand Down Expand Up @@ -114,6 +109,9 @@
// Put loot in crate
for(var/obj/O in src)
O.loc = C

visible_message("<span class='warning'><b>[src]</b> stops moving!</span>")
qdel(src)
..()

/mob/living/simple_animal/hostile/mimic/crate/AttackingTarget()
Expand Down Expand Up @@ -146,6 +144,9 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca

for(var/atom/movable/M in src)
M.loc = get_turf(src)

visible_message("<span class='warning'><b>[src]</b> stops moving!</span>")
qdel(src)
..()

/mob/living/simple_animal/hostile/mimic/copy/ListTargets()
Expand Down Expand Up @@ -206,3 +207,96 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
response_help = "pets the"
attacktext = "hugs"
a_intent = INTENT_HELP

/mob/living/simple_animal/hostile/mimic/prophunt
name = "mimic"
real_name = "mimic"
desc = "Absolutely not de-beaked or harmless. Keep away from corpses."
icon = 'icons/mob/animal.dmi'
icon_state = "headcrab"
icon_living = "headcrab"
icon_dead = "headcrab_dead"

maxHealth = 100
health = 100
speed = 2
harm_intent_damage = 5
melee_damage = 5

universal_understand = TRUE
universal_speak = TRUE

var/next_transform = 0
var/transform_cd = 30 SECONDS

var/atom/my_prototype

/mob/living/simple_animal/hostile/mimic/prophunt/Destroy()
my_prototype = null
return ..()

/mob/living/simple_animal/hostile/mimic/prophunt/death()
icon = initial(icon)
..()

/mob/living/simple_animal/hostile/mimic/prophunt/MouseEntered()
. = ..()
if(istype(my_prototype, /obj/item))
apply_outline()

/mob/living/simple_animal/hostile/mimic/prophunt/MouseExited()
. = ..()
if(istype(my_prototype, /obj/item))
remove_outline()

/mob/living/simple_animal/hostile/mimic/prophunt/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
. = ..()
if(src != over && istype(my_prototype, /obj/item))
remove_outline()

/mob/living/simple_animal/hostile/mimic/prophunt/RangedAttack(atom/A, params)
mimic_attack(A)

/mob/living/simple_animal/hostile/mimic/prophunt/UnarmedAttack(atom/A)
if(a_intent == INTENT_HELP)
mimic_attack(A)
return
return ..()

/mob/living/simple_animal/hostile/mimic/prophunt/examine(mob/user)
if(!my_prototype)
return ..()
return my_prototype.examine(user)

/mob/living/simple_animal/hostile/mimic/prophunt/proc/CopyObject(atom/A)
my_prototype = A

name = A.name
real_name = A.name
desc = A.desc
icon = A.icon
icon_state = A.icon_state
icon_living = icon_state
appearance = A.appearance
set_dir(A.dir)
layer = initial(A.layer)
plane = initial(A.plane)
density = A.density

/mob/living/simple_animal/hostile/mimic/prophunt/proc/mimic_attack(atom/A)
var/list/black_types = list(/turf, /mob/living/carbon/human, /obj/structure/table, /obj/structure/cable, /obj/structure/disposalpipe, /obj/machinery/atmospherics/pipe)
if(next_transform > world.time)
to_chat(src, "До следующего превращения: [round((next_transform - world.time) / 10)] секунд.")
return
if(is_type_in_list(A, black_types) || !A.has_valid_appearance())
to_chat(src, "Вы не можете превратиться в [A.name].")
return

CopyObject(A)
next_transform = world.time + transform_cd

/mob/living/simple_animal/hostile/mimic/prophunt/med_hud_set_health()
return

/mob/living/simple_animal/hostile/mimic/prophunt/med_hud_set_status()
return
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/obj/item/roller,\
/obj/structure/closet/crate,\
/obj/structure/closet/acloset,\
/mob/living/simple_animal/hostile/mimic,\
/mob/living/simple_animal/hostile/mimic/crate,\
/mob/living/simple_animal/hostile/viscerator,\
/mob/living/simple_animal/hostile/hivebot,\
/obj/item/device/analyzer,\
Expand Down
3 changes: 3 additions & 0 deletions taucetistation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
#include "code\game\gamemodes\factions\infestation.dm"
#include "code\game\gamemodes\factions\malf_silicons.dm"
#include "code\game\gamemodes\factions\ninja.dm"
#include "code\game\gamemodes\factions\props.dm"
#include "code\game\gamemodes\factions\revolution.dm"
#include "code\game\gamemodes\factions\shadowling.dm"
#include "code\game\gamemodes\factions\strike_teams.dm"
Expand Down Expand Up @@ -591,6 +592,7 @@
#include "code\game\gamemodes\objectives\hijack.dm"
#include "code\game\gamemodes\objectives\nuclear.dm"
#include "code\game\gamemodes\objectives\objectives.dm"
#include "code\game\gamemodes\objectives\prop_points.dm"
#include "code\game\gamemodes\objectives\reproduct.dm"
#include "code\game\gamemodes\objectives\silence.dm"
#include "code\game\gamemodes\objectives\steal.dm"
Expand Down Expand Up @@ -639,6 +641,7 @@
#include "code\game\gamemodes\roles\heist.dm"
#include "code\game\gamemodes\roles\malf_unit.dm"
#include "code\game\gamemodes\roles\ninja.dm"
#include "code\game\gamemodes\roles\prop.dm"
#include "code\game\gamemodes\roles\revolution.dm"
#include "code\game\gamemodes\roles\shadowling.dm"
#include "code\game\gamemodes\roles\strike_teams.dm"
Expand Down