|
419 | 419 | desc = "A strange eye, said to have been torn from an omniscient creature that used to roam the wastes." |
420 | 420 | icon_state = "godeye" |
421 | 421 | item_state = "godeye" |
422 | | - vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS |
| 422 | + vision_flags = SEE_TURFS |
423 | 423 | darkness_view = 8 |
424 | 424 | lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE |
425 | 425 | resistance_flags = LAVA_PROOF | FIRE_PROOF |
426 | 426 | clothing_flags = SCAN_REAGENTS |
| 427 | + var/obj/effect/proc_holder/expose/expose_ability |
427 | 428 |
|
428 | 429 | /obj/item/clothing/glasses/godeye/Initialize() |
429 | 430 | . = ..() |
430 | | - ADD_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT) |
| 431 | + expose_ability = new(expose_ability) |
| 432 | + |
| 433 | +/obj/item/clothing/glasses/godeye/equipped(mob/living/user, slot) |
| 434 | + . = ..() |
| 435 | + if(ishuman(user) && slot == ITEM_SLOT_EYES) |
| 436 | + ADD_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT) |
| 437 | + user.AddAbility(expose_ability) |
| 438 | + |
| 439 | +/obj/item/clothing/glasses/godeye/dropped(mob/living/user) |
| 440 | + . = ..() |
| 441 | + // Behead someone, their "glasses" drop on the floor |
| 442 | + // and thus, the god eye should no longer be sticky |
| 443 | + REMOVE_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT) |
| 444 | + user.RemoveAbility(expose_ability) |
431 | 445 |
|
432 | 446 | /obj/item/clothing/glasses/godeye/attackby(obj/item/W as obj, mob/user as mob, params) |
433 | 447 | if(istype(W, src) && W != src && W.loc == user) |
|
438 | 452 | if(iscarbon(user)) |
439 | 453 | var/mob/living/carbon/C = user |
440 | 454 | C.update_inv_wear_mask() |
441 | | - else |
442 | | - to_chat(user, span_notice("The eye winks at you and vanishes into the abyss, you feel really unlucky.")) |
443 | | - qdel(src) |
| 455 | + qdel(src) |
444 | 456 | ..() |
445 | 457 |
|
| 458 | +/obj/effect/proc_holder/expose |
| 459 | + name = "Expose" |
| 460 | + desc = "Expose an enemy, increasing all damage dealt to them by 15% for 10 seconds, effect is magnified on megafauna." |
| 461 | + action_background_icon_state = "bg_demon" |
| 462 | + action_icon = 'icons/mob/actions/actions_items.dmi' |
| 463 | + action_icon_state = "expose" |
| 464 | + ranged_mousepointer = 'icons/effects/mouse_pointers/expose_target.dmi' |
| 465 | + var/cooldown_time = 1 MINUTES |
| 466 | + COOLDOWN_DECLARE(scan_cooldown) |
| 467 | + |
| 468 | +/obj/effect/proc_holder/expose/on_lose(mob/living/user) |
| 469 | + remove_ranged_ability() |
| 470 | + |
| 471 | +/obj/effect/proc_holder/expose/Click(location, control, params) |
| 472 | + . = ..() |
| 473 | + if(!isliving(usr)) |
| 474 | + return TRUE |
| 475 | + var/mob/living/user = usr |
| 476 | + fire(user) |
| 477 | + |
| 478 | +/obj/effect/proc_holder/expose/fire(mob/living/carbon/user) |
| 479 | + if(active) |
| 480 | + remove_ranged_ability(span_notice("You relax your god eye.")) |
| 481 | + else |
| 482 | + add_ranged_ability(user, span_notice("You squint your god eye. <B>Left-click a creature to expose it!</B>"), TRUE) |
| 483 | + |
| 484 | +/obj/effect/proc_holder/expose/InterceptClickOn(mob/living/caller, params, atom/target) |
| 485 | + . = ..() |
| 486 | + if(.) |
| 487 | + return |
| 488 | + if(ranged_ability_user.stat) |
| 489 | + remove_ranged_ability() |
| 490 | + return |
| 491 | + if(!COOLDOWN_FINISHED(src, scan_cooldown)) |
| 492 | + to_chat(ranged_ability_user, span_warning("You try to focus your god eye, but it's too tired. Give it some time to recharge!")) |
| 493 | + return |
| 494 | + if(!isliving(target) || target == ranged_ability_user) |
| 495 | + return |
| 496 | + var/mob/living/living_target = target |
| 497 | + living_target.apply_status_effect(STATUS_EFFECT_EXPOSED) |
| 498 | + living_target.Jitter(5) |
| 499 | + to_chat(living_target, span_warning("You feel the gaze of a malevolent presence focus on you!")) |
| 500 | + ranged_ability_user.playsound_local(get_turf(ranged_ability_user), 'sound/magic/smoke.ogg', 50, TRUE) |
| 501 | + living_target.playsound_local(get_turf(living_target), 'sound/hallucinations/i_see_you1.ogg', 50, TRUE) |
| 502 | + to_chat(ranged_ability_user, "You glare at [living_target], exposing them!") |
| 503 | + COOLDOWN_START(src, scan_cooldown, cooldown_time) |
| 504 | + addtimer(CALLBACK(src, .proc/cooldown_over, ranged_ability_user), cooldown_time) |
| 505 | + remove_ranged_ability() |
| 506 | + return TRUE |
| 507 | + |
| 508 | +/obj/effect/proc_holder/expose/proc/cooldown_over() |
| 509 | + to_chat(usr, (span_notice("Your god eye is focused enough to expose again!"))) |
| 510 | + |
446 | 511 | /obj/item/clothing/glasses/AltClick(mob/user) |
447 | 512 | if(glass_colour_type && ishuman(user)) |
448 | 513 | var/mob/living/carbon/human/H = user |
|
0 commit comments