Skip to content

Commit

Permalink
v0.4.3: Fixed door and lift usage; made chat toggleable; etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Rehermann (Gustavo6046) committed May 2, 2019
1 parent ef0a3a7 commit 62f3233
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 14 deletions.
1 change: 1 addition & 0 deletions CVarInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ server string zb_extraweap = "";
server float zb_autouseinterval = 9;
server bool zb_autouse = true;
server bool zb_autonodes = true;
server bool zb_talk = true;

server string zb_bnames = "Jack:Persephone:Èmille:Robert:Amanda:Maria:Mary:Josh:Wagner:John:Louis:Gabriel:Renato:Alejandro:Alexander:Heinrich:Caesar:Walter:Amy:Lawrence:Marylenne:Leonhart:Leonard:Jackson:Lee:Bert:Humberto:Mike:Pablo:Michael:Hitchcock:Hilton:Ronald:Robinson:Son:House:Romulus:Peter:Peterson:Zephyrus:Robin:Paul:Paula:Thorson:Robohead:Minchson:James:Jamilton:Greg:Gregor:Gregory:Victoria:Anita:Whindersson:Melody:Xonon:Xihil";
1 change: 1 addition & 0 deletions KeyConf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ defaultbind kp7 "summon ZTDeleteNodes 0"
defaultbind kp8 "summon ZTUploadNodes"
defaultbind kp9 "summon ZTPromptNodes"
defaultbind kp* "kill ZetaBotPawn"
defaultbind kp, "summonfriend zetabot 0"

addkeysection "ZetaBot" "zetabots"

Expand Down
33 changes: 29 additions & 4 deletions ZScript.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,21 @@ class ZTBotController : Actor
UseHistory.Delete(i--);
}

td.HitLine.Activate(possessed, 0, SPAC_Use);
Line l = td.HitLine;
DebugLog(LT_VERBOSE, "["..myName.." USE NODE LOGS] Auto-activating wall! Line special: "..l.Special);
l.Activate(possessed, 0, SPAC_Use);

Level.ExecuteSpecial(
l.Special,
possessed,
l, 0,

l.Args[0],
l.Args[1],
l.Args[2],
l.Args[3],
l.Args[4]
);

currNode = ZTPathNode.plopNode(pos, ZTPathNode.NT_USE);
currNode.Angle = Angle;
Expand Down Expand Up @@ -897,7 +911,7 @@ class ZTBotController : Actor

void BotChat(String kind, double importance)
{
if ( importance < FRandom(0, 2.25) )
if ( !CVar.FindCVar("zb_talk").GetBool() || importance < FRandom(0, 1.8) )
return;

A_PlaySound("zetabot/"..myVoice.."/"..kind, CHAN_VOICE, attenuation: 0.7);
Expand Down Expand Up @@ -1010,8 +1024,19 @@ class ZTBotController : Actor
if ( useData.HitLine.Special > 0 ) {
Line l = useData.HitLine;
DebugLog(LT_VERBOSE, "["..myName.." USE NODE LOGS] Activating wall! Line special: "..l.Special);

useData.HitLine.Activate(possessed, 0, SPAC_Use);
l.Activate(possessed, 0, SPAC_Use);

Level.ExecuteSpecial(
l.Special,
possessed,
l, 0,

l.Args[0],
l.Args[1],
l.Args[2],
l.Args[3],
l.Args[4]
);
}

else {
Expand Down
15 changes: 6 additions & 9 deletions ZetaCode/PawnClasses/ZetaBotPawn.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,26 @@ class ZetaBotPawn : Actor
Mass 100;
PainChance 255;

+PICKUP
+SOLID
+SHOOTABLE
+DROPOFF
+PICKUP
+FRIENDLY
+SLIDESONWALLS
+CANPASS
+ACTLIKEBRIDGE
+CANUSEWALLS
+CANPUSHWALLS
+CANPASS
+FLOORCLIP
+WINDTHRUST
+TELESTOMP
+NOBLOCKMONST
+FRIENDLY
+ISMONSTER
+CANUSEWALLS
+ACTIVATEMCROSS
+PUSHABLE
+ISMONSTER
+THRUSPECIES
+BLOCKASPLAYER
//+BLOCKASPLAYER

-NOTDMATCH
-NOBLOCKMAP
-CANPUSHWALLS
}

static String GetSomeType(Actor anchor = null)
Expand Down
118 changes: 118 additions & 0 deletions ZetaCode/WeaponSupport/ZetaWeapon.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,121 @@ class ZetaWeapon : Actor
return false;
}
}


// For DECORATE users.
class ZTMyWeapon : ZetaWeapon {
bool bZT_SPLASHDANGER;
bool bZT_HASALT;
bool bZT_MELEE;
bool bZT_ALTMELEE;
bool bZT_HITSCAN;
bool bZT_ALTHITSCAN;

double DangerRadius;
double MeleeDamage;
double AltMeleeDamage;
class<Actor> MissileType;
class<Actor> AltMissileType;
class<Weapon> WeaponType;
double BulletMinDamage;
double BulletMaxDamage;
double AltBulletMinDamage;
double AltBulletMaxDamage;
double BaseRating;
double AltBaseRating;
double DangerRating;
double BulletSpreadH;
double AltBulletSpreadH;
double BulletSpreadV;
double AltBulletSpreadV;
double DangerFactor;

property MissileType: MissileType;
property AltMissileType: MissileType;
property MeleeDamage: MeleeDamage;
property AltMeleeDamage: AltMeleeDamage;
property BulletMinDamage: BulletMinDamage;
property BulletMaxDamage: BulletMaxDamage;
property AltBulletMinDamage: AltBulletMinDamage;
property AltBulletMaxDamage: AltBulletMaxDamage;
property BaseRating: BaseRating;
property AltBaseRating: AltBaseRating;
property DangerRating: DangerRating;
property DangerRadius: DangerRadius;
property WeaponType: WeaponType;
property BulletSpreadH: BulletSpreadH;
property AltBulletSpreadH: AltBulletSpreadH;
property BulletSpreadV: BulletSpreadV;
property AltBulletSpreadV: AltBulletSpreadV;
property DangerFactor: DangerFactor;

default {
ZTMyWeapon.DangerRadius 128;
ZTMyWeapon.MeleeDamage 3;
ZTMyWeapon.AltMeleeDamage 5;
ZTMyWeapon.MissileType "Rocket";
ZTMyWeapon.AltMissileType "Rocket";
ZTMyWeapon.BulletMinDamage 2;
ZTMyWeapon.BulletMaxDamage 5;
ZTMyWeapon.AltBulletMinDamage 3;
ZTMyWeapon.AltBulletMaxDamage 7;
ZTMyWeapon.BaseRating 500;
ZTMyWeapon.DangerRating 300;
ZTMyWeapon.BulletSpreadH 10;
ZTMyWeapon.AltBulletSpreadH 10;
ZTMyWeapon.BulletSpreadV 3;
ZTMyWeapon.AltBulletSpreadV 3;
ZTMyWeapon.DangerFactor 2.25;
}

override bool IsPickupOf(Weapon other)
{
return other.GetClass() == WeaponType;
}

override bool bHasAltFire(Actor shooter)
{
return bZT_HASALT;
}

override double RateSelf(Actor shooter, Actor target)
{
if ( bZT_SPLASHDANGER && shooter.Distance3D(target) < DangerRadius )
return DangerRating - shooter.Distance3D(target) * DangerFactor;

return BaseRating / sqrt(shooter.Distance2D(target)) * 2;
}

override double AltRateSelf(Actor shooter, Actor target)
{
if ( bZT_SPLASHDANGER && shooter.Distance3D(target) < DangerRadius )
return DangerRating - shooter.Distance3D(target) * DangerFactor;

return AltBaseRating / sqrt(shooter.Distance2D(target)) * 2;
}

override void Fire(Actor shooter, Actor target)
{
if (bZT_MELEE)
shooter.LineAttack(shooter.angle, 32, 0, MeleeDamage * FRandom(1, 8), "Punch", "BulletPuff", 0);

else if (bZT_HITSCAN)
ZetaBullet.FireABullet(shooter, "Gold", target, random(BulletMinDamage, BulletMaxDamage), BulletSpreadH, BulletSpreadV);

else
shooter.SpawnMissileAngle(MissileType, shooter.angle, target == null ? 0 : ((target.pos.z - shooter.pos.z) * 20 / target.Distance2D(shooter)));
}

override void AltFire(Actor shooter, Actor target)
{
if (bZT_MELEE)
shooter.LineAttack(shooter.angle, 32, 0, AltMeleeDamage * FRandom(1, 8), "Punch", "BulletPuff", 0);

else if (bZT_ALTHITSCAN)
ZetaBullet.FireABullet(shooter, "Gold", target, random(AltBulletMinDamage, AltBulletMaxDamage), AltBulletSpreadH, AltBulletSpreadV);

else
shooter.SpawnMissileAngle(ALtMissileType, shooter.angle, target == null ? 0 : ((target.pos.z - shooter.pos.z) * 20 / target.Distance2D(shooter)));
}
}
2 changes: 1 addition & 1 deletion config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
NAME=ZetaBot
VERSION=0.4.2
VERSION=0.4.3

ADDFOLDER ZetaCode
ADDFOLDER sprites
Expand Down

0 comments on commit 62f3233

Please sign in to comment.