sTankCannon
0
-1
-4
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
canbeX = 0;
//myhealth = 100;
myhealth = global.mod_tankHcannon;
image_speed = 0.15;
shaking = 0;
flashing = 0;
offx = 0;
offy = 0;
damaged = 0;
charge_frame = 0;
alarm[1] = 120;
canfire = 1;
cooldown = 0;
shots = 0;
knockback = 0;
//1.4.4
charge = 0;
chargeType = sTankCannonCharge;
beamIndex = 0;
beamType = "PLASMA";
1
603
7
0
0
-1
2
self
0
0
1
if (shots > 0 && damaged == 0) {
event_user(2);
shots -= 1;
knockback = 5;
alarm[2] = 20;
} else with (oTank) tgt_aangle = 0;
1
603
7
0
0
-1
2
self
0
0
1
canfire = 1;
charge_frame = 0;
1
603
7
0
0
-1
2
self
0
0
1
gravity_direction = 270;
gravity = 0.12;
vspeed = -1;
with (oTankArm) event_user(2);
1
603
7
0
0
-1
2
self
0
0
1
if (beamIndex == 1) {
oTank.iceOff = 1;
} else {
oTank.iceOff = 0;
}
if (damaged == 0) {
image_angle = direction;
if (canfire && cooldown == 0) {
if (charge_frame < 22) {
charge_frame += 0.25;
} else {
shots = 3 - beamIndex;
alarm[2] = 30;
cooldown = 230;
with (oTank) tgt_aangle = 20;
}
}
if (cooldown > 0) {
cooldown -= 1;
if (charge_frame > 0 && shots == 0) {
charge_frame -= 1;
}
if (cooldown == 100) {
//charge_frame = 0;
if (beamIndex < 2) {
beamIndex += 1;
} else {
beamIndex = 0;
}
// determine types/sprites
switch beamIndex {
case 0: chargeType = sTankCannonCharge; beamType = "PLASMA"; break;
case 1: chargeType = sTankCannonCharge2; beamType = "ICE"; break;
case 2: chargeType = sTankCannonCharge3; beamType = "WAVE"; break;
}
}
}
}
if (shaking > 0) {
shaking -= 1;
offx = random_range(-1, 1);
offy = random_range(-1, 1);
} else {
offx = 0;
offy = 0;
}
if (flashing > 0) flashing -= 1;
if (knockback > 0) {
knockback -= 1;
with (oTank) aangle -= 5;
}
if (damaged) {
if (image_angle > 180) image_angle -= 360;
if (image_angle > 0) image_angle -= 1;
if (image_angle < 0) image_angle += 1;
}
// 1.4.4
charge = charge_frame/22;
if (!damaged) image_speed = max(0, (charge_frame/22)/1.8);
1
603
7
0
0
-1
2
self
0
0
1
with (other) event_user(0);
1
603
7
0
0
-1
2
self
0
0
1
if (damaged == 0) {
myhealth -= 10 * (1 + other.smissile * 2);
event_user(0);
with (other) event_user(0);
}
1
603
7
0
0
-1
2
self
0
0
1
if (damaged == 0 && flashing < 3) {
myhealth -= 1;
event_user(0);
with (other) {
event_user(0);
if (!pbeam) instance_destroy();
}
}
1
603
7
0
0
-1
2
self
0
0
1
if (damaged == 0 && !flashing) {
myhealth -= 2;
event_user(0);
}
1
603
7
0
0
-1
2
self
0
0
1
if (damaged == 0 && !flashing) {
myhealth -= 1;
event_user(0);
}
1
603
7
0
0
-1
2
self
0
0
1
if (gravity != 0) {
repeat (10) {
var boom = make_explosion1(x + irandom_range(-19, 64), y + irandom_range(-14, 17));
boom.depth = depth - 1;
}
sprite_index = sTankCannonDest;
}
gravity = 0;
speed = 0;
1
603
7
0
0
-1
2
self
0
0
1
var projx, projy, proj;
projx = x + lengthdir_x(60, direction);
projy = y + lengthdir_y(60, direction);
proj = instance_create(projx, projy, oTankProjectile);
proj.direction = direction;
proj.image_angle = direction;
proj.speed = 4;
proj.type = beamType;
if (beamType == "ICE") {
proj.sprite_index = sTankProj2;
} else if (beamType == "WAVE") {
proj.depth = -200;
proj.sprite_index = sTankProj3;
}
sfx_play(sndAutrackFire);
1
603
7
0
0
-1
2
self
0
0
1
if (damaged == 0) {
damaged = 1;
with (oTankArm) {
event_user(1);
}
image_speed = 0;
//alarm[0] = 60;
alarm[0] = 15;
sfx_play(sndRobotExpl);
repeat (3) {
var boom = make_explosion1(x + irandom_range(10, -10), y + irandom_range(10, -10));
boom.depth = depth - 1;
}
}
1
603
7
0
0
-1
2
self
0
0
1
if (damaged == 0) {
shaking = 8;
flashing = 5;
if (myhealth > 60) with (oTankArm) sprite_index = sTankShoulder;
if (myhealth <= 60) with (oTankArm) sprite_index = sTankShoulder1;
if (myhealth <= 30) with (oTankArm) sprite_index = sTankShoulder2;
if (myhealth <= 0) event_user(1);
sfx_stop(sndRobotHit2);
sfx_play(sndRobotHit2);
}
1
603
7
0
0
-1
2
self
0
0
1
draw_sprite_ext(sprite_index, -1, x + offx, y + offy, 1, 1, image_angle, -1, 1);
if (!damaged) draw_sprite_ext(chargeType, image_index, x + offx, y + offy, 1, 1, image_angle, -1, charge);
if (flashing && damaged == 0) {
draw_set_blend_mode(bm_add);
repeat (2) draw_sprite_ext(sprite_index, -1, x + offx, y + offy, 1, 1, image_angle, -1, flashing / 5);
draw_set_blend_mode(bm_normal);
}
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
-1