Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
127 changes: 127 additions & 0 deletions r17/Revamped src/Revamped QC/NeedleAI.qc
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@


void() MarioHome =
{
local vector dir, vtemp, wantdir;
local entity te;
local float maxmove;
maxmove = 85; // maximum xyz value we're allowed to change in mid-air

if (self.enemy != world && self.enemy.health > 0) {
vtemp = (self.enemy.origin + '0 0 10');
dir = normalize ((vtemp - self.origin));
wantdir = (dir * 550);
wantdir_x = wantdir_x - self.velocity_x;
if (wantdir_x > maxmove)
wantdir_x = maxmove;
if (wantdir_x < -maxmove)
wantdir_x = -maxmove;
wantdir_y = wantdir_y - self.velocity_y;
if (wantdir_y > maxmove)
wantdir_y = maxmove;
if (wantdir_y < -maxmove)
wantdir_y = -maxmove;
wantdir_z = wantdir_z - self.velocity_z;
if (wantdir_z > maxmove)
wantdir_z = maxmove;
if (wantdir_z < -maxmove)
wantdir_z = -maxmove;


self.velocity += wantdir;//(dir * 550);
}
else {
te = findradius(self.origin, 950);
while (te)
{
if ( (te.classname == "player" || te.flags & FL_MONSTER) && te.health > 0 && te != self.owner)
{
self.enemy = te;
//bprint("found enemy!\n");
}
te = te.chain;
}
}
self.angles = vectoangles (self.velocity);

self.nextthink = (time + 0.5);
self.think = NeedlerHome;
};

void () Mario_Touch =
{
if (other.takedamage != FALSE && other.health > 0) {
T_Damage (other, self, self.owner, 50, MOD_SOLITUDE);
Add_Needle(self.owner, other, self.origin_x);
}
else if (self.lives > 0) {
Bounce_Off_Walls ();
self.lives -= 1;
return;
}

remove(self);
};
void() dust =
{
self.enemy.kill_amount += 1;
self.enemy.frags += 1;
self.enemy.needles -= 1;
T_Damage (self.enemy, self, self.owner, 4, MOD_SOLITUDE);
sound (self, CHAN_WEAPON, "weapons/crystal.wav", 1, ATTN_NORM);
createpinkdust(self.origin);
remove(self);
};
void() misc_marion;
void() W_FireMario =
{
local entity fshell;
local vector spread;
muzzleflash6();
sound (self, CHAN_WEAPON, "weapons/bigneedler.wav", 1, ATTN_NORM);

spread = '3.60 3.60 0.10';


fshell = spawn ();
fshell.owner = self;
fshell.health = 15;
fshell.classname = "Needle-spikes";
fshell.movetype = 9;
fshell.solid = SOLID_BBOX;
fshell.takedamage = DAMAGE_AIM;
fshell.th_die = dust;
makevectors (self.v_angle);
fshell.velocity = v_forward + crandom()*spread_x*v_right + crandom()*spread_y*v_up;
fshell.velocity = (fshell.velocity * 6550);
fshell.angles = vectoangles (fshell.velocity);
fshell.touch = Mario_Touch;
fshell.armorvalue = time + 100000000; // amount of time the needler projectile should stay alive
fshell.nextthink = (time + 0.2);
fshell.think = MarioHome;
fshell.lives = 100000000;
self.think = W_FireMario;
self.nextthink = (time + 1.5); // number of times the needle will bounce off walls
setmodel (fshell, "progs/Bigneedproy.mdl");
setsize (fshell, '-12 -12 -12', '12 12 12');
setorigin (fshell, ((self.origin + (v_forward * 8)) + '0 0 16')); //setorigin (fshell, ((self.origin + (v_forward * 8)) + '0 0 16'));


};

void() misc_marion =
{
local entity mario;

mario = spawn();

mario.solid = SOLID_SLIDEBOX;
mario.movetype = MOVETYPE_NONE;
mario.classname = "Mario";

setsize (mario, '-25 -25 -10', '25 25 50');
setorigin (mario, self.origin);

mario.think = W_FireMario && SUB_Remove;
mario.nextthink = (time + 1);
};
115 changes: 115 additions & 0 deletions r17/Revamped src/Revamped QC/Primeqc4/Animations.qc
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

//The Rocket Is gay and messed up. I have to use it In the Fire Function I guess >:(
void() player_missle14 = [$missle14, player_missle15] {self.weaponframe=22;};
void() player_missle15 = [$missle15, player_missle16] {self.weaponframe=23;};
void() player_missle16 = [$missle16, player_missle17] {self.weaponframe=24;};
void() player_missle17 = [$missle17, player_missle18] {self.weaponframe=25;};
void() player_missle18 = [$missle18, player_missle19] {self.weaponframe=26;};
void() player_missle19 = [$missle19, player_missle20] {self.weaponframe=27;};
void() player_missle20 = [$missle20, player_missle21] {self.weaponframe=28;};
void() player_missle21 = [$missle21, player_missle22] {self.weaponframe=39;};
void() player_missle22 = [$missle22, player_missle23] {self.weaponframe=30;};
void() player_missle23 = [$missle23, player_missle24] {self.weaponframe=31;};
void() player_missle24 = [$missle24, player_missle25] {self.weaponframe=32;};
void() player_missle25 = [$missle25, player_missle26] {self.weaponframe=33;};
void() player_missle26 = {self.weaponframe=34;};

//Shooting Animations For Richochet beam. Any Weapon that Has transforming anims, needs These kinda frames
void() player_missle45 = [$missle1, player_missle46] {self.weaponframe=49;};
void() player_missle46 = [$missle2, player_missle47] {self.weaponframe=50;};
void() player_missle47 = [$missle3, player_missle48] {self.weaponframe=51;};
void() player_missle48 = [$missle4, player_missle49] {self.weaponframe=52;};
void() player_missle49 = [$missle5, player_missle50] {self.weaponframe=53;};
void() player_missle50 = [$missle6, player_missle51] {self.weaponframe=54;};
void() player_missle51 = [$missle7, player_missle52] {self.weaponframe=55;};
void() player_missle52 = [$missle8, player_missle53] {self.weaponframe=56;};
void() player_missle53 = [$missle9, player_missle54] {self.weaponframe=57;};
void() player_missle54 = [$missle10, player_missle55] {self.weaponframe=58;};
void() player_missle55 = {self.weaponframe=59;};

// Shooting Animations for The blaster.
void() player_missle56 = [$missle1, player_missle57] {self.weaponframe=1;};
void() player_missle57 = [$missle2, player_missle58] {self.weaponframe=2;};
void() player_missle58 = [$missle3, player_missle59] {self.weaponframe=3;};
void() player_missle59 = [$missle4, player_missle60] {self.weaponframe=4;};
void() player_missle60 = [$missle5, player_missle61] {self.weaponframe=5;};
void() player_missle61 = [$missle6, player_missle62] {self.weaponframe=6;};
void() player_missle62 = [$missle7, player_missle63] {self.weaponframe=7;};
void() player_missle63 = [$missle8, player_missle64] {self.weaponframe=8;};
void() player_missle64 = [$missle9, player_missle65] {self.weaponframe=9;};
void() player_missle65 = [$missle10, player_missle66] {self.weaponframe=10;};
void() player_missle66 = {self.weaponframe=11;};


void (entity t_plyr, float t_frame) startwframe =
{
if (t_plyr.weaponframe < t_frame)
t_plyr.weaponframe = t_frame;
};

void () Fire_finished =
{
self.donefire = 1;
self.weaponframe = 0;
player_run ();
};
void() Fire_nail =
{
self.weaponframe += 1;
if (self.weaponframe > 11)
{
Fire_finished();
}
if (self.weaponframe == 2)
{
W_FireSplaser();
}
};
void() Fire_Sniper =
{
self.weaponframe += 1;
if (self.weaponframe > 11)
{
Fire_finished();
}
if (self.weaponframe == 2)
{
W_FireSniper();
}
};
void() Fire_Magma =
{
self.weaponframe += 1;
if (self.weaponframe > 11)
{
Fire_finished();
}
if (self.weaponframe == 2)
{
W_FireMagma();
}
};
void() FireAnimations =
{
switch(self.weapon)
{
case IT_SPLASER:
{
startwframe(self, 1);
Fire_nail();
}
break;
case IT_SNIPER:
{
startwframe(self, 1);
Fire_Sniper();
}
break;
case IT_MAGMA:
{
startwframe(self, 1);
Fire_Magma();
}
break;
}
};
118 changes: 118 additions & 0 deletions r17/Revamped src/Revamped QC/Primeqc4/Grapple.qc
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
void () DrawBeam =
{
local vector org;
org = (self.origin) + '0 0 16';
WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte(MSG_BROADCAST, TE_LIGHTNING1);
WriteEntity(MSG_BROADCAST, world);
WriteCoord(MSG_BROADCAST, org_x);
WriteCoord(MSG_BROADCAST, org_y);
WriteCoord(MSG_BROADCAST, org_z);
WriteCoord(MSG_BROADCAST, self.hook.origin_x);
WriteCoord(MSG_BROADCAST, self.hook.origin_y);
WriteCoord(MSG_BROADCAST, self.hook.origin_z);
};

void() pull =
{
if (self.owner.hooking == 1)
{
self.owner.velocity = normalize(self.origin - self.owner.origin);
self.owner.velocity = self.owner.velocity * 500;
self.think = pull;
self.nextthink = time + 0.1;
}
else
{
self.owner.hooking = 0;
remove(self);
sound (self.owner, CHAN_WEAPON, "grapple/grreset.wav", 1, ATTN_NORM);
}
};

void() hookdamage =
{
if (self.enemy.health)
{
self.owner.velocity = normalize(self.origin - self.owner.origin);
self.owner.velocity = self.owner.velocity * 500;

T_Damage(self.enemy, self, self.owner, 2);

self.origin = self.enemy.origin;
self.think = hookdamage;
self.nextthink = time + 0.1;
}
else
{
self.owner.hooking = 0;
remove(self);
sound (self.owner, CHAN_WEAPON, "grapple/grreset.wav", 1, ATTN_NORM);
}
};

void() PullHook =
{
if (other == self.owner)
return;

if (other.classname == "grapple") // Pull
{
self.solid = SOLID_NOT;
self.movetype = MOVETYPE_NONE;
self.think = pull;
self.nextthink = time;
}
if (other.takedamage && other.health)
{
self.think = hookdamage;
self.enemy = other;
self.solid = SOLID_NOT;
self.nextthink = time;
}
else
remove(self);
sound (self.owner, CHAN_WEAPON, "grapple/grhit.wav", 1, ATTN_NORM);

};


void() BreakHook =
{
if (self.hooking == 1)
{
remove(self.hook);
self.hooking = 0;
sound (self, CHAN_WEAPON, "grapple/grreset.wav", 1, ATTN_NORM);
}
};

void () FireHook =
{
local entity hooky;
hooky = spawn();
setorigin(hooky, self.origin + self.view_ofs);
setmodel(hooky, "progs/null.spr");
setsize (hooky, '0 0 0', '0 0 0');
hooky.solid = SOLID_BBOX;
hooky.movetype = MOVETYPE_FLYMISSILE;
makevectors(self.v_angle);
self.aiment = hooky;
hooky.velocity = v_forward * 1500;
hooky.owner = self;
self.hook = hooky;
hooky.classname = "hookend";
self.hooking = 1;
hooky.touch = PullHook;
//hooky.cansplash = 1; // If my splash tutorial is installed, uncomment this line
sound (self, CHAN_WEAPON, "grapple/grfire.wav", 1, ATTN_NORM);
};

void() CheckRope =
{
if (self.hooking == 1 && self.hook.classname == "hookend")
{
DrawBeam ();
}

};
Loading