Skip to content

Commit

Permalink
Merge pull request #4 from Shanjaq/shanjaq/push_fix1
Browse files Browse the repository at this point in the history
fix spells pushing things that should stay put, add cold-wet interactions
  • Loading branch information
Shanjaq authored Apr 9, 2019
2 parents afdb7cd + 84b38f9 commit 30fe563
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 28 deletions.
4 changes: 2 additions & 2 deletions phcc/AERO.HC
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void ()aero_dissolve = {
{
dir = normalize(self.origin - found.origin);
SpawnPuff ( (found.origin + random(found.mins, found.maxs)) + (dir * ((found.size_x + found.size_y) * 0.25000)), '360.00000 360.00000 360.00000', 3.00000, found);
if ((found.solid != SOLID_BSP) && (found.movetype != MOVETYPE_NOCLIP) && (found.classname != "aero") && (found.classname != "bloodspot"))
if ((found.solid != SOLID_BSP) && (found.movetype != MOVETYPE_NOCLIP) && (found.mass < 9999) && (found.classname != "aero") && (found.classname != "bloodspot"))
{
if (found.flags & FL_ONGROUND) {
found.flags ^= FL_ONGROUND;
Expand Down Expand Up @@ -132,7 +132,7 @@ void ()aero_whip = {
while (head)
{
//if (head.takedamage == DAMAGE_YES) {
if ((head.solid != SOLID_BSP) && (head.movetype != MOVETYPE_NOCLIP) && (head.classname != "aero") && (head.classname != "bloodspot") && (head.touch != puzzle_touch) && (head.touch != weapon_touch))
if ((head.solid != SOLID_BSP) && (head.movetype != MOVETYPE_NOCLIP) && (head.mass < 9999) && (head.classname != "aero") && (head.classname != "bloodspot") && (head.touch != puzzle_touch) && (head.touch != weapon_touch))
{
if (head.flags & FL_ONGROUND) {
head.flags ^= FL_ONGROUND;
Expand Down
41 changes: 28 additions & 13 deletions phcc/FROSTY.HC
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
void ()frost_ice_touch =
{
if ((other.flags2 & FL_ALIVE) && (other.flags & FL_ONGROUND) && (random() < 0.75))
{
other.velocity += (other.velocity * 0.5);
other.flags ^= FL_ONGROUND;
}

};

void ()frost_ice_sheet = {
local float pc;
if (time < self.splash_time)
Expand All @@ -24,18 +34,21 @@ void ()frost_ice_sheet = {

void ()frost_timer = {
local float pc;
local vector move_angle;

self.dmg = self.spelldamage + random(self.spelldamage*(-0.12500), self.spelldamage*0.12500);
if (time < self.splash_time) {
self.scale = (1.00000 - ((self.splash_time - time) / self.lifetime)) + 0.50000;
pc = pointcontents(self.origin);
if ( (((pc == CONTENT_WATER) || (pc == CONTENT_SLIME)) || (pc == CONTENT_LAVA)) && (chunk_cnt < CHUNK_MAX) ) {
if ( ((((pc == CONTENT_WATER) || (pc == CONTENT_SLIME)) || (pc == CONTENT_LAVA))) && (chunk_cnt < CHUNK_MAX) ) {
chunk_cnt += 1;
//setmodel ( self, "models/dwarf.mdl");
self.owner = world;
self.velocity = '0 0 3';
self.friction = 0;
self.angles_x = 0;
setsize(self, '-128 -128 -3', '128 128 3');
self.mass = 999;
self.mass = 9999;
self.scale = 2.00000;
self.cnt = 1;
self.movetype = MOVETYPE_FLYMISSILE;
Expand All @@ -58,6 +71,7 @@ void ()frost_timer = {
self.lifetime = 5.00000;
self.splash_time = (time + self.lifetime);

self.touch = frost_ice_touch;
self.think = frost_ice_sheet;
AdvanceThinkTime(self, 0.1);
}
Expand All @@ -68,19 +82,20 @@ void ()frost_timer = {

while (head)
{
if (head.takedamage == DAMAGE_YES) {
if (head != self.owner)
if ((head.takedamage == DAMAGE_YES) && (head != self.owner))
{
if (head.status_effects & STATUS_WET)
self.dmg *= 2.00000;

if ( ((((((head.health <= self.dmg) || (((head.classname == "player") && (head.frozen <= -5.00000)) && (head.health < 200.00000))) && (head.solid != SOLID_BSP)) && !(head.artifact_active & ART_INVINCIBILITY)) && (head.thingtype == THINGTYPE_FLESH)) && (head.health < 100.00000)) )
{
SnowJob ( head, self.owner);
}
else if (head.frozen <= 0)
{
if ( ((((((head.health <= self.dmg) || (((head.classname == "player") && (head.frozen <= -5.00000)) && (head.health < 200.00000))) && (head.solid != SOLID_BSP)) && !(head.artifact_active & ART_INVINCIBILITY)) && (head.thingtype == THINGTYPE_FLESH)) && (head.health < 100.00000)) )
{
SnowJob ( head, self.owner);
}
else if (head.frozen <= 0)
{
T_Damage ( head, self, self.owner, self.dmg);
}

T_Damage ( head, self, self.owner, self.dmg);
}

}
head = head.chain;
}
Expand Down
2 changes: 1 addition & 1 deletion phcc/MG_AI.hc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ local float mod = 0.00000;
old_right = v_right;
if ( (slope == '0.00000 0.00000 0.00000') ) {

traceline ( self.origin, (self.origin - '0.00000 0.00000 300.00000'), TRUE, self);
traceline ( (self.origin + '0 0 10'), (self.origin - '0.00000 0.00000 300.00000'), TRUE, self);
if ( ((trace_fraction > 0.05000) && (self.movetype == MOVETYPE_STEP)) ) {

self.flags ^= FL_ONGROUND;
Expand Down
6 changes: 4 additions & 2 deletions phcc/explode.hc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void (float howbig, float howmuch)IceBoom =
{
local entity head;
local float dist;
local string grr;
local vector move_angle;
dist = howbig;
head = findradius(self.origin, howbig);
while(head)
Expand Down Expand Up @@ -170,7 +170,9 @@ void (float howbig, float howmuch)IceBoom =
newmis.drawflags = MLS_ABSLIGHT;
newmis.abslight = 1;
newmis.skin = 1;
makevectors (self.velocity);
move_angle = vectoangles(self.velocity);
move_angle_x *= -1;
makevectors (move_angle);
traceline ( (self.origin - (v_forward * 24.00000)), (self.origin + (v_forward * 48.00000)), 1, self);
if ((trace_ent.classname == "worldspawn") && (trace_fraction < 1)) {
//sprint(self.owner, "hit a wall!\n");
Expand Down
12 changes: 10 additions & 2 deletions phcc/icemace.hc
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,25 @@ void ()FreezeTouch = {
}

}
self.dmg = 16;
if (other.status_effects & STATUS_WET)
{
self.dmg *= 2.00000;
particle2 ( self.origin, ('-15.00000 -15.00000 -15.00000' + (self.velocity * 0.0125)), ('15.00000 15.00000 15.00000' + (self.velocity * 0.125)), (144.00000 + random(15.00000)), PARTICLETYPE_BLOB, 7.00000);
particle2 ( self.origin, '-7.00000 -7.00000 -7.00000', '7.00000 7.00000 7.00000', (144.00000 + random(15.00000)), PARTICLETYPE_BLOB, 12.00000);
}

if ( (other.flags & FL_COLDHEAL) ) {

T_Damage ( other, self, self.owner, 5.00000);
} else {

if ( ((((((other.health <= 20.00000) || (((other.classname == "player") && (other.frozen <= -5.00000)) && (other.health < 200.00000))) && (other.solid != SOLID_BSP)) && !(other.artifact_active & ART_INVINCIBILITY)) && (other.thingtype == THINGTYPE_FLESH)) && (other.health < 100.00000)) ) {
if ( ((((((other.health <= (self.dmg + 4)) || (((other.classname == "player") && (other.frozen <= -5.00000)) && (other.health < 200.00000))) && (other.solid != SOLID_BSP)) && !(other.artifact_active & ART_INVINCIBILITY)) && (other.thingtype == THINGTYPE_FLESH)) && (other.health < 100.00000)) ) {

SnowJob ( other, self.owner);
} else {

T_Damage ( other, self, self.owner, 16.00000);
T_Damage ( other, self, self.owner, self.dmg);

}

Expand Down
2 changes: 1 addition & 1 deletion phcc/object.hc
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ void ()obj_ballista = {
precache_sound ( "weapons/ballwind.wav");
if ( !self.mass ) {

self.mass = 1000.00000;
self.mass = 9999;

}
CreateEntityNew ( self, ENT_BALLISTA, "models/ballista.mdl", chunk_death);
Expand Down
2 changes: 1 addition & 1 deletion phcc/pk.hc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local vector push = '0.00000 0.00000 0.00000';
while (head)
{
//if (head.takedamage == DAMAGE_YES) {
if ((head.solid != SOLID_BSP) && (head.movetype != MOVETYPE_NOCLIP) && (head != self.owner) && (head.classname != "bloodspot") && (head.touch != puzzle_touch) && (head.touch != weapon_touch))
if ((head.solid != SOLID_BSP) && (head.movetype != MOVETYPE_NOCLIP) && (head.mass < 9999) && (head != self.owner) && (head.classname != "bloodspot") && (head.touch != puzzle_touch) && (head.touch != weapon_touch))
{
if (head.flags & FL_ONGROUND) {
head.flags ^= FL_ONGROUND;
Expand Down
3 changes: 1 addition & 2 deletions phcc/status.hc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void() burn_status_effect =
if ((pc == CONTENT_WATER) || (pc == CONTENT_SLIME) || (self.goalentity.status_effects & STATUS_WET))
{
self.burn_time = time;
setorigin(self, self.goalentity.origin);
sound (self, CHAN_WEAPON, "misc/fout.wav", 1, ATTN_NORM);
return;
}
Expand Down Expand Up @@ -130,7 +129,6 @@ void() toxic_status_effect =
if ((pc == CONTENT_WATER) || (self.goalentity.status_effects & STATUS_WET))
{
self.toxic_time = time;
setorigin(self, self.goalentity.origin);
sound (self, CHAN_WEAPON, "misc/fout.wav", 1, ATTN_NORM);
return;
}
Expand Down Expand Up @@ -199,6 +197,7 @@ void() status_controller_think =

if ((self.goalentity.origin == VEC_ORIGIN) || (self.goalentity == world))
{
sound ( self, CHAN_WEAPON, "misc/null.wav", 0.30000, ATTN_NORM);
self.think = remove_status_controller;
AdvanceThinkTime(self, HX_FRAME_TIME);
return;
Expand Down
8 changes: 4 additions & 4 deletions phcc/twister.hc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void() junker_think = {
if (((head.classname == "razorwind") || (head.classname == "aero"))&& (head.auraV != 1)) {
head.auraV = 1;
}
if ((vlen(head.origin - self.origin) < 400) ) {
if ((vlen(head.origin - self.origin) < 400) && (head.mass < 9999)) {
pull_speed = 0.5;
normalize(pull);
pull *= pull_speed;
Expand All @@ -176,7 +176,7 @@ void() junker_think = {
head.velocity += pull;
}

if ((vlen(head.origin - self.origin) < 300) ) {
if ((vlen(head.origin - self.origin) < 300) && (head.mass < 9999)) {
pull_speed = 1;
normalize(pull);
pull *= pull_speed;
Expand All @@ -186,7 +186,7 @@ void() junker_think = {
pull_z = 0;
head.velocity += pull;
}
if ((vlen(head.origin - self.origin) < 200) ) {
if ((vlen(head.origin - self.origin) < 200) && (head.mass < 9999)) {
pull_speed = 2;
normalize(pull);
pull *= pull_speed;
Expand All @@ -197,7 +197,7 @@ void() junker_think = {
head.velocity += pull;

}
if ((vlen(head.origin - self.origin) < 100) ) {
if ((vlen(head.origin - self.origin) < 100) && (head.mass < 9999)) {
if (head.flags & FL_ONGROUND) {
head.flags ^= FL_ONGROUND;
}
Expand Down

0 comments on commit 30fe563

Please sign in to comment.