Skip to content

Commit

Permalink
vis_content code is "fun", someone kill me
Browse files Browse the repository at this point in the history
  • Loading branch information
silencer-pl committed Sep 27, 2024
1 parent 71d9202 commit 4fdb452
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 18 deletions.
19 changes: 16 additions & 3 deletions code/datums/ammo/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,22 @@
icon = 'icons/Surge/boss_bot/boss_proj.dmi'
icon_state = "laser"
ping = null
flags_ammo_behavior = AMMO_XENO|AMMO_SKIPS_ALIENS|AMMO_STOPPED_BY_COVER
flags_ammo_behavior = AMMO_XENO|AMMO_SKIPS_ALIENS|AMMO_IGNORE_ARMOR|AMMO_IGNORE_COVER|AMMO_IGNORE_RESIST
damage_type = BURN
damage = 50
damage = 40
max_range = 20
accuracy = 100
shell_speed = 0.5
shell_speed = 0.4

/datum/ammo/xeno/dbl_laser
icon = 'icons/Surge/boss_bot/boss_proj.dmi'
icon_state = "twin_laser"
name = "double laser beam"
ping = null
flags_ammo_behavior = AMMO_XENO|AMMO_SKIPS_ALIENS|AMMO_STOPPED_BY_COVER
damage_type = BURN
damage = 15
penetration = 20
max_range = 5
accuracy = 70
shell_speed = 0.8
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@
ability_primacy = XENO_PRIMARY_ACTION_3
xeno_cooldown = 60
plasma_cost = 0

/datum/action/xeno_action/activable/fire_cannon

name = "Fire Cannon"
action_icon_state = "runner_bonespur"
ability_name = "Cannon"
macro_path = /datum/action/xeno_action/verb/fire_cannon
action_type = XENO_ACTION_CLICK
ability_primacy = XENO_PRIMARY_ACTION_4
xeno_cooldown = 35
plasma_cost = 0

var/ammo_type = /datum/ammo/xeno/dbl_laser
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@
set hidden = TRUE
var/action_name = "Rapid Relocation"
handle_xeno_macro(src, action_name)

/datum/action/xeno_action/verb/fire_cannon()
set category = "Alien"
set name = "Fire Main Cannon"
set hidden = TRUE
var/action_name = "Fire Cannon"
handle_xeno_macro(src, action_name)
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,22 @@
return
for(var/mob/living/carbon/human/target_to_warn in mobs_in_range)
INVOKE_ASYNC(target_to_warn, TYPE_PROC_REF(/mob/living/carbon/human/, warning_ping))
apply_cooldown()
xeno.overlays += (image('icons/effects/surge_hit_warning_64.dmi', "aoe_surge"))
xeno.anchored = 1
if(xeno.armor_deflection > 20) xeno.armor_deflection = 20
sleep(xeno.aoe_delay)
xeno.overlays -= (image('icons/effects/surge_hit_warning_64.dmi', "aoe_surge"))
xeno.anchored = 0
xeno.armor_deflection = initial(xeno.armor_deflection)
var/list/mobs_in_view = list()
for(var/mob/living/carbon/human/target in view("15x15",xeno))
if(mobs_in_view.Find(target) == 0)
mobs_in_view.Add(target)
if(mobs_in_view.len == 0) return
playsound(xeno, 'sound/items/pulse3.ogg', 50)
for(var/mob/living/carbon/human/target_to_shoot in mobs_in_range)
if(mobs_in_view.Find(target_to_shoot) != 0)
var/turf/target = get_turf(target_to_shoot)
var/obj/projectile/projectile = new /obj/projectile(xeno.loc, create_cause_data(initial(xeno.caste_type), xeno))
var/datum/ammo/ammo_datum = GLOB.ammo_list[ammo_type]
projectile.generate_bullet(ammo_datum)
projectile.fire_at(target, xeno, xeno, ammo_datum.max_range, ammo_datum.shell_speed)
var/turf/target = get_turf(target_to_shoot)
var/obj/projectile/projectile = new /obj/projectile(xeno.loc, create_cause_data(initial(xeno.caste_type), xeno))
var/datum/ammo/ammo_datum = GLOB.ammo_list[ammo_type]
projectile.generate_bullet(ammo_datum)
projectile.fire_at(target, xeno, xeno, ammo_datum.max_range, ammo_datum.shell_speed)

apply_cooldown()
return ..()

/obj/item/prop/big_warning_ping
Expand Down Expand Up @@ -156,6 +150,7 @@
return
var/turf/turf_center = get_turf(affected_atom)
var/list/mobs_in_range = list()
apply_cooldown()
xeno.anchored = 1
if(xeno.armor_deflection > 20) xeno.armor_deflection = 20
for(var/mob/living/carbon/human/target in range("15x15",turf_center))
Expand All @@ -169,8 +164,6 @@
sleep(100)
xeno.anchored = 0
xeno.armor_deflection = initial(xeno.armor_deflection)

apply_cooldown()
return ..()

/obj/item/prop/arrow
Expand Down Expand Up @@ -380,11 +373,11 @@
if(turf_in_range == targeted_turf)
to_chat(xeno, SPAN_WARNING("Target Turf is too close!"))
return
apply_cooldown()
animate_warnings(targeted_turf)
sleep(50)
animate_movement(targeted_turf)
process_movement(targeted_turf)
apply_cooldown()
return ..()

/obj/item/prop/ring_line
Expand All @@ -407,4 +400,75 @@
icon = 'icons/Surge/effects/ring.dmi'
icon_state = "target_rings"

/datum/action/xeno_action/activable/fire_cannon/proc/handle_crosshair_animation(mob/target_mob)
var/obj/item/prop/ring_line/ring_line_left = new()
var/obj/item/prop/ring_line/ring_line_rignt = new()
var/obj/item/prop/ring_rings/ring_ring = new()
var/mob/living/carbon/human/target_human = target_mob
if(!target_mob)return
var/matrix/A = matrix()
var/matrix/B = matrix()
var/matrix/C = matrix()
var/matrix/D = matrix()
var/matrix/E = matrix()
E.Scale(0.001,0.001)
A.Turn(30)
B.Turn(60)
ring_line_left.apply_transform(A)
ring_line_left.color = "#680606"
ring_line_left.forceMove(target_human.vis_contents)
ring_line_left.forceMove(target_human.vis_contents)
C.Turn(-30)
D.Turn(-60)
ring_line_rignt.apply_transform(C)
ring_line_rignt.color = "#680606"
ring_line_rignt.forceMove(target_human.vis_contents)
ring_ring.color = "#680606"
ring_ring.forceMove(target_human.vis_contents)
animate(ring_line_left, transform = B, color = "#ff0000", time = 30, easing = LINEAR_EASING)
animate(ring_ring, color = "#ff0000", time = 30, easing = LINEAR_EASING)
animate(ring_line_rignt, transform = D, color = "#ff0000", time = 30, easing = LINEAR_EASING)
sleep(30)
animate(ring_ring, transform = E, color = "#707070", alpha = 0, time = 4,easing=LINEAR_EASING)
animate(ring_line_left, color = "#ff7575", time = 1,easing=LINEAR_EASING)
animate(ring_line_rignt, color = "#ff7575", time = 1,easing=LINEAR_EASING)
sleep(1)
animate(ring_line_left, color = "#722525", time = 1,easing=LINEAR_EASING)
animate(ring_line_rignt, color = "#722525", time = 1,easing=LINEAR_EASING)
sleep(1)
animate(ring_line_left, color = "#ff7575", time = 1,easing=LINEAR_EASING)
animate(ring_line_rignt, color = "#ff7575", time = 1,easing=LINEAR_EASING)
sleep(1)
animate(ring_line_left, color = "#722525", alpha = 0, time = 1,easing=LINEAR_EASING)
animate(ring_line_rignt, color = "#722525", alpha = 0, time = 1,easing=LINEAR_EASING)
sleep(5)
qdel(ring_line_rignt)
qdel(ring_line_left)
qdel(ring_ring)

/datum/action/xeno_action/activable/fire_cannon/use_ability(atom/target)
var/mob/living/carbon/xenomorph/xeno = owner
if (!istype(xeno))
return
if (!action_cooldown_check())
return
var/mob/living/carbon/human/laser_target = target
if(!laser_target) return
apply_cooldown()
handle_crosshair_animation(laser_target)
sleep(30)
var/mob/mob_to_shoot
for(var/mob/mob in view("15x15",xeno))
if(mob == laser_target)
mob_to_shoot = mob
break
if(!mob_to_shoot)
return
else
var/turf/target_to_hit = get_turf(mob_to_shoot)
var/obj/projectile/projectile = new /obj/projectile(xeno.loc, create_cause_data(initial(xeno.caste_type), xeno))
var/datum/ammo/ammo_datum = GLOB.ammo_list[ammo_type]
projectile.generate_bullet(ammo_datum)
projectile.fire_at(target_to_hit, xeno, xeno, ammo_datum.max_range, ammo_datum.shell_speed)
return ..()

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
/datum/action/xeno_action/activable/surge_proj,
/datum/action/xeno_action/activable/rapid_missles/,
/datum/action/xeno_action/activable/relocate,
/datum/action/xeno_action/activable/fire_cannon,
)
mutation_type = BOSS_NORMAL
icon_xeno = 'icons/Surge/boss_bot/boss.dmi'
Expand Down
Binary file modified icons/Surge/boss_bot/boss_proj.dmi
Binary file not shown.

0 comments on commit 4fdb452

Please sign in to comment.