Spoiler if (releasedKeys & $10) && (player.class == CLASS_SNIPER) {
with(currentWeapon) {
event_user(3)
}
}
if(pressedKeys & $80) && taunting==false && omnomnomnom==false{
if(not place_free(x,y+1) && place_free(x,y)) {
if canCloak {
if currentWeapon.readyToStab==true {
playsound(x,y,JumpSnd);
vspeed = -jumpStrength;
}
}
else {
playsound(x,y,JumpSnd);
vspeed = -jumpStrength;
}
}
else if((canDoublejump == 1) and (doublejumpUsed == 0) and (vspeed>-jumpStrength)) {
vspeed = -jumpStrength;
playsound(x,y,JumpSnd);
doublejumpUsed = 1;
moveStatus = 0;
}
}
xoffset = view_xview[0];
yoffset = view_yview[0];
xsize = view_wview[0];
ysize = view_hview[0];
if(keyState & $10) && taunting==false && omnomnomnom==false {
if (global.isHost==true) || (global.isHost==false && distance_to_point(xoffset+xsize/2,yoffset+ysize/2) < 1600) || (player.class == CLASS_DEMOMAN) with(currentWeapon) event_user(1);
} else {
with(currentWeapon) event_user(3);
}
// Right click
if(keyState & $08) && (taunting==false || player.class == CLASS_DEMOMAN) && omnomnomnom==false{
if (global.isHost==true) || (distance_to_point(xoffset+xsize/2,yoffset+ysize/2) < 1600) with(currentWeapon) event_user(2);
}
// Cloak
if ((pressedKeys & $08) && canCloak && ((cloakAlpha <= 0.5 and cloak) || (cloakAlpha == 1 and !cloak)) && !intel && taunting==false && !(keyState & $10)) {
cloak = !cloak;
}
if moveStatus == 1 speedfactor = 0.65;
else if moveStatus == 2 speedfactor = 0.17;
else if moveStatus == 3 speedfactor = 0.1;
else speedfactor = 0.85;
if (intel) && speedfactor > 0.75 speedfactor = 0.75;
if (tranquilized) speedfactor = 0.6;
if tranquilized = true {
if !variable_local_exists("tranquilizerParticleType") {
tranquilizerParticleType = part_type_create();
part_type_sprite(tranquilizerParticleType,TranqS,true,false,true);
part_type_alpha2(tranquilizerParticleType,1,1);
part_type_life(tranquilizerParticleType,15,20);
part_type_scale(tranquilizerParticleType,1,1);
part_type_speed(tranquilizerParticleType,1,2,0,0)
part_type_direction(tranquilizerParticleType,-180,180,0,0)
}
if !variable_global_exists("tranquilizerParticleSystem") && tranquilized = true {
global.tranquilizerParticleSystem = part_system_create();
part_system_depth(global.tranquilizerParticleSystem, -9010);
}
if tranquilized = true && speedfactor = 0.6 {
part_particles_create(global.tranquilizerParticleSystem,x,y,tranquilizerParticleType,1);
}
}
if(speedfactor<0.7 && tranquilized = false) {
if !variable_local_exists("jumpFlameParticleType") && moveStatus != 3 {
jumpFlameParticleType = part_type_create();
part_type_sprite(jumpFlameParticleType,FlameS,true,false,true);
part_type_alpha2(jumpFlameParticleType,1,0.3);
part_type_life(jumpFlameParticleType,2,5);
part_type_scale(jumpFlameParticleType,0.7,-0.65);
}
if !variable_global_exists("jumpFlameParticleSystem") && moveStatus != 3 {
global.jumpFlameParticleSystem = part_system_create();
part_system_depth(global.jumpFlameParticleSystem, 10);
}
if(vspeed<0) {
vspeed-=0.1;
if(global.particles == PARTICLES_NORMAL) {
if(speedfactor>0.1 and (random(10)/10)> speedfactor) {
effect_create_below(ef_smoke,x-hspeed*1.2,y-vspeed*1.2+20,0,c_gray);
}
}
if speedfactor > 0.3 {
if(global.particles == PARTICLES_NORMAL or global.particles == PARTICLES_ALTERNATIVE) {
if(random(7)<5) {
part_particles_create(global.jumpFlameParticleSystem,x,y+19,jumpFlameParticleType,1);
}
}
}
} else {
moveStatus = 0;
//if(variable_local_exists("jumpFlameParticleType")) {
//part_type_destroy(jumpFlameParticleType);
//}
}
}
if(keyState & $40) && taunting==false && omnomnomnom==false{
if !canCloak hspeed -= runPower*speedfactor;
else if currentWeapon.readyToStab==true hspeed -= runPower*speedfactor;
}
if(keyState & $20) && taunting==false && omnomnomnom==false{
if !canCloak hspeed += runPower*speedfactor;
else if currentWeapon.readyToStab==true hspeed += runPower*speedfactor;
}
if(pressedKeys & $04) {
setChatBubble(player, 45);
}
// flame bubble
if flamecount>0 && player.class != CLASS_PYRO && random(80) <= 1 {
setChatBubble(player, 49);
}
pressedKeys = 0;
releasedKeys = 0;
if (moveStatus = 2) {
hspeed/=1.04;
} else {
if (moveStatus = 3) {
hspeed/=1.002;
} else {
hspeed/=1.15;
}
}
if(abs(hspeed)<0.2 /*and not moveStatus = 3*/) {
hspeed=0;
animationImage=0;
}
if(place_free(x,y+1)) {
vspeed += 0.6;
if(vspeed>10) {
vspeed=10;
}
animationImage = 1;
} else {
//moveStatus = 0;
if(place_free(x,y)) {
doublejumpUsed = 0;
}
}
if(speed>15) {
speed=15;
}
if intel {
if cloak==true {
cloak=false;
cloakAplha=1;
}
}
animationImage = (animationImage+abs(hspeed)/20) mod CHARACTER_ANIMATION_LEN;
if collision_point(x,y,SpawnRoom,0,0) player.quickspawn = 1;
else player.quickspawn=0;
//CP Collision
if collision_point(x,y,CaptureZone,0,0) && cloak!=1 && ubered==0 && inZone==0 {
if player.class==CLASS_SCOUT capStrength = 2;
else capStrength = 1;
zone = instance_nearest(x,y,CaptureZone);
if player.team != zone.cp.team && zone.cp.locked==0 && (zone.cp.redCappers == 0 && zone.cp.blueCappers == 0) playsound(x,y,CPBeginCapSnd);
if player.team == TEAM_RED {
if zone.cp.blueCappers > 0 && zone.cp.locked == 0 && zone.cp.redCappers == 0 && zone.cp.team == TEAM_RED{
playsound(x,y,CPDefendedSnd);
recordEventInLog(2,player.team,player.name);
}
zone.cp.redCappers+=capStrength;
}
else if player.team == TEAM_BLUE {
if zone.cp.redCappers > 0 && zone.cp.locked == 0 && zone.cp.blueCappers == 0 && zone.cp.team == TEAM_BLUE{
playsound(x,y,CPDefendedSnd);
recordEventInLog(2,player.team,player.name);
}
zone.cp.blueCappers+=capStrength;
}
inZone =1;
}
else if collision_point(x,y,CaptureZone,0,0) && (cloak == 1 || ubered == 1 )&& inZone == 1 {
if player.class==CLASS_SCOUT capStrength = 2;
else capStrength =1;
zone = instance_nearest(x,y,CaptureZone);
if player.team==TEAM_RED zone.cp.redCappers-=capStrength;
else if player.team==TEAM_BLUE zone.cp.blueCappers-=capStrength;
inZone = 0;
}
else if !collision_point(x,y,CaptureZone,0,0) && inZone == 1{
if player.class==CLASS_SCOUT capStrength = 2;
else capStrength =1;
zone = instance_nearest(x,y,CaptureZone);
if player.team==TEAM_RED zone.cp.redCappers-=capStrength;
else if player.team==TEAM_BLUE zone.cp.blueCappers-=capStrength;
inZone=0;
}
// drop intel if ubered
if(intel) && ubered == 1 {
event_user(5);
}
//gotta regenerate some nuts
if nutsNBolts < 100 nutsNBolts += 0.1;
else if nutsNBolts > 100 nutsNBolts = 100;