diff --git a/CVarInfo.txt b/CVarInfo.txt index 7547e7a..9746ee4 100644 --- a/CVarInfo.txt +++ b/CVarInfo.txt @@ -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"; \ No newline at end of file diff --git a/KeyConf.txt b/KeyConf.txt index 317f41d..f175a0d 100644 --- a/KeyConf.txt +++ b/KeyConf.txt @@ -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" diff --git a/ZScript.zsc b/ZScript.zsc index 9c0c810..f361c96 100644 --- a/ZScript.zsc +++ b/ZScript.zsc @@ -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; @@ -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); @@ -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 { diff --git a/ZetaCode/PawnClasses/ZetaBotPawn.zsc b/ZetaCode/PawnClasses/ZetaBotPawn.zsc index d00ebbf..ac90b6f 100644 --- a/ZetaCode/PawnClasses/ZetaBotPawn.zsc +++ b/ZetaCode/PawnClasses/ZetaBotPawn.zsc @@ -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) diff --git a/ZetaCode/WeaponSupport/ZetaWeapon.zsc b/ZetaCode/WeaponSupport/ZetaWeapon.zsc index 7d35af1..55c53a1 100644 --- a/ZetaCode/WeaponSupport/ZetaWeapon.zsc +++ b/ZetaCode/WeaponSupport/ZetaWeapon.zsc @@ -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 MissileType; + class AltMissileType; + class 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))); + } +} \ No newline at end of file diff --git a/config b/config index 63f90c0..7890833 100644 --- a/config +++ b/config @@ -1,6 +1,6 @@ #!/bin/bash NAME=ZetaBot -VERSION=0.4.2 +VERSION=0.4.3 ADDFOLDER ZetaCode ADDFOLDER sprites