Merge pull request #882 from CHOMPStation2/master

Master into Metroids1.0 Branch
This commit is contained in:
Razgriz
2020-11-21 01:20:56 -07:00
committed by GitHub
4 changed files with 17 additions and 6 deletions
+12 -3
View File
@@ -98,6 +98,16 @@
if(reload_count >= reload_max)
try_reload()
return FALSE
//CHOMP Addition: This section here is special snowflake code for metroids only, or for whatever else in the future that you want to have move and shoot at the same time. Basically, this is a non-stupid version of the above intended for ranged vore mobs i.e. metroids. ranged_attack_delay is stupid because it sleeps the entire mob. This new ranged_cooldown_time is smarter in the sense that it is an internalized timer. Try not to confuse the names.
if(ranged_cooldown_time) //If you have a non-zero number in a mob's variables, this pattern begins.
if(ranged_cooldown <= world.time) //Further down, a timer keeps adding to the ranged_cooldown variable automatically.
visible_message("<span class='danger'><b>\The [src]</b> fires at \the [A]!</span>") //Leave notice of shooting.
shoot(A) //Perform the shoot action
if(casingtype) //If the mob is designated to leave casings...
new casingtype(loc) //... leave the casing.
ranged_cooldown = world.time + ranged_cooldown_time //Special addition here. This is a timer. Keeping updating the time after shooting. Add that ranged cooldown time specified in the mob to the world time.
return TRUE //End these commands here.
visible_message("<span class='danger'><b>\The [src]</b> fires at \the [A]!</span>")
shoot(A)
@@ -106,10 +116,9 @@
if(ranged_attack_delay)
ranged_post_animation(A)
return TRUE
// Shoot a bullet at something.
/mob/living/simple_mob/proc/shoot(atom/A)
if(A == get_turf(src))
@@ -134,6 +143,7 @@
if(needs_reload)
reload_count++
// if(distance >= special_attack_min_range && distance <= special_attack_max_range)
// return TRUE
@@ -240,7 +250,6 @@
set_AI_busy(FALSE)
// Override these four for special custom animations (like the GOLEM).
/mob/living/simple_mob/proc/melee_pre_animation(atom/A)
do_windup_animation(A, melee_attack_delay)
@@ -108,6 +108,8 @@
var/melee_attack_delay = 2 // If set, the mob will do a windup animation and can miss if the target moves out of the way.
var/ranged_attack_delay = null
var/special_attack_delay = null
var/ranged_cooldown = 0 //CHOMP Addition. This is part of a timer in combat.dm.
var/ranged_cooldown_time = 0 //CHOMP Addition: This variable can be thrown into mob variables in order to allow the mob to move AND shoot at the same time. The previous "ranged_attack_delay" is a dumb way of handling ranged attacks because it sleeps the entire mob - this one uses an internalized timer so it is slightly smarter.
//Special attacks
// var/special_attack_prob = 0 // The chance to ATTEMPT a special_attack_target(). If it fails, it will do a regular attack instead.
+2 -2
View File
@@ -41,14 +41,14 @@
pda.play_ringtone()
if(blink && !(src in pda.notifying_programs))
pda.overlays += image('icons/obj/pda.dmi', "pda-r")
pda.overlays += image(icon, "pda-r")
pda.notifying_programs |= src
/datum/data/pda/proc/unnotify()
if(src in pda.notifying_programs)
pda.notifying_programs -= src
if(!pda.notifying_programs.len)
pda.overlays -= image('icons/obj/pda.dmi', "pda-r")
pda.overlays -= image(icon, "pda-r")
// An app has a button on the home screen and its own UI
/datum/data/pda/app
+1 -1
View File
@@ -300,7 +300,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(can_use(usr))
start_program(find_program(/datum/data/pda/app/main_menu))
notifying_programs.Cut()
overlays -= image('icons/obj/pda.dmi', "pda-r")
overlays -= image(icon, "pda-r")
to_chat(usr, "<span class='notice'>You press the reset button on \the [src].</span>")
else
to_chat(usr, "<span class='notice'>You cannot do this while restrained.</span>")