Skip to content

Commit

Permalink
v0.7.2: Rating fixes, and more fairness for ZetaBullet (hitscan) weapons
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Rehermann (Gustavo6046) committed May 11, 2019
1 parent 9e84b44 commit 9af313d
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 27 deletions.
4 changes: 2 additions & 2 deletions ZetaCode/WeaponSupport/Doom/ZetaRL.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class ZetaRL : ZetaWeapon
override double RateSelf(Actor shooter, Actor target)
{
if ( shooter.Distance3D(target) < 150 )
return 300 - shooter.Distance3D(target) * 2;
return shooter.Distance3D(target) * 4;

return 900 / sqrt(shooter.Distance2D(target)) * 2.5;
return 1100 / sqrt(shooter.Distance2D(target)) * 2.5;
}

override void Fire(Actor shooter, Actor target)
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Doom/ZetaSSG.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ZetaSSG : ZetaWeapon

override double RateSelf(Actor shooter, Actor target)
{
return 2000 / sqrt(shooter.Distance2D(target) * 1.5);
return 3000 / sqrt(shooter.Distance2D(target) * 1.8);
}

override void Fire(Actor shooter, Actor target)
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Heretic/ZetaBlaster.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ZetaBlaster : ZTMyWeapon {

ZTMyWeapon.WeaponType "Blaster";
ZTMyWeapon.BaseRating 800;
ZTMyWeapon.RatingFade 1.75;
ZTMyWeapon.RatingFade 1.2;
ZTMyWeapon.Puff "BlasterPuff";
ZTMyWeapon.ShootSound "weapons/blastershoot";
ZTMyWeapon.BulletSpreadH 5.625;
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Heretic/ZetaGauntlets.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ZetaGauntlets : ZTMyWeapon {

ZTMyWeapon.WeaponType "Staff";
ZTMyWeapon.BaseRating 1100;
ZTMyWeapon.RatingFade 75;
ZTMyWeapon.RatingFade 9;
ZTMyWeapon.ShootSound "weapons/gauntletsuse";
ZTMyWeapon.Puff "GauntletPuff1";
ZetaWeapon.FireInterval 1142857;
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Heretic/ZetaGoldWand.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ZetaGoldWand : ZTMyWeapon {

ZTMyWeapon.WeaponType "GoldWand";
ZTMyWeapon.BaseRating 300;
ZTMyWeapon.RatingFade 1.6;
ZTMyWeapon.RatingFade 0.9;
ZTMyWeapon.Puff "GoldWandPuff1";
ZTMyWeapon.ShootSound "weapons/wandhit";
ZTMyWeapon.BulletSpreadH 5.625;
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Heretic/ZetaHereticCrossbow.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class ZetaHereticCrossbow : ZTMyWeapon {
default {
ZTMyWeapon.WeaponType "Crossbow";
ZTMyWeapon.BaseRating 1000;
ZTMyWeapon.RatingFade 3;
ZTMyWeapon.RatingFade 1.5;

ZetaWeapon.FireInterval 6285714;
ZetaWeapon.AmmoType "CrossbowAmmo";
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Heretic/ZetaMace.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class ZetaFiremace : ZTMyWeapon {
default {
ZTMyWeapon.WeaponType "Mace";
ZTMyWeapon.BaseRating 2000;
ZTMyWeapon.RatingFade 30;
ZTMyWeapon.RatingFade 5;

ZetaWeapon.FireInterval 857143;
ZetaWeapon.AmmoType "MaceAmmo";
Expand Down
6 changes: 3 additions & 3 deletions ZetaCode/WeaponSupport/Heretic/ZetaPhoenixRod.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ class ZetaPhoenixRod : ZTMyWeapon {

ZTMyWeapon.WeaponType "PhoenixRod";
ZTMyWeapon.BaseRating 10000;
ZTMyWeapon.RatingFade 48;
ZTMyWeapon.RatingFade 2;

ZTMyWeapon.DangerRadius 96;
ZTMyWeapon.DangerRadius 112;
ZTMyWeapon.DangerRating 8000;
ZTMyWeapon.DangerFactor 6;
ZTMyWeapon.DangerFactor 2;

ZetaWeapon.FireInterval 5714286;
ZetaWeapon.AmmoType "PhoenixRodAmmo";
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Heretic/ZetaSkullRod.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class ZetaSkullRod : ZTMyWeapon {
default {
ZTMyWeapon.WeaponType "SkullRod";
ZTMyWeapon.BaseRating 2000;
ZTMyWeapon.RatingFade 1.625;
ZTMyWeapon.RatingFade 1.5;

ZetaWeapon.FireInterval 2285714;
ZetaWeapon.AmmoType "SkullRodAmmo";
Expand Down
2 changes: 1 addition & 1 deletion ZetaCode/WeaponSupport/Heretic/ZetaStaff.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ZetaStaff : ZTMyWeapon {

ZTMyWeapon.WeaponType "Staff";
ZTMyWeapon.BaseRating 50;
ZTMyWeapon.RatingFade 75;
ZTMyWeapon.RatingFade 20;
ZTMyWeapon.Puff "StaffPuff";
ZetaWeapon.FireInterval 4000000;
ZetaWeapon.MinAmmo 0;
Expand Down
10 changes: 4 additions & 6 deletions ZetaCode/WeaponSupport/ZetaBullet.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ class ZetaBullet : Actor
Default
{
Damage (0);
Speed 85; // TO-DO: a more reasonable speed for a bullet while avoiding FastProjectile
Speed 100; // We need the most reasonable possible speed for a bullet while avoiding FastProjectile.
ZetaBullet.BulletColor "Gold";
Species "ZetaBot";
+THRUSPECIES
Projectile;
Radius 1;
Height 1;
}

void SetColor(String col)
Expand All @@ -27,11 +29,7 @@ class ZetaBullet : Actor
{
ZetaBullet bullet;

if (target == null)
bullet = ZetaBullet(shooter.SpawnMissileAngle("ZetaBullet", shooter.angle, 0));

else
bullet = ZetaBullet(shooter.SpawnMissile(target, "ZetaBullet", shooter));
bullet = ZetaBullet(shooter.SpawnMissileAngle("ZetaBullet", shooter.angle, 0));

if ( bullet != null )
{
Expand Down
39 changes: 32 additions & 7 deletions ZetaCode/WeaponSupport/ZetaWeapon.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class ZetaWeapon : Actor
// For simplicity.
class ZTMyWeapon : ZetaWeapon {
bool bZT_SPLASHDANGER;
bool bZT_ALTSPLASHDANGER;
bool bZT_HASALT;
bool bZT_MELEE;
bool bZT_ALTMELEE;
Expand All @@ -147,6 +148,7 @@ class ZTMyWeapon : ZetaWeapon {
bool bZT_ALTMELEECUSTOMDAMAGE;

property ZT_SPLASHDANGER: bZT_SPLASHDANGER;
property bZT_ALTSPLASHDANGER: bZT_ALTSPLASHDANGER;
property ZT_HASALT: bZT_HASALT;
property ZT_MELEE: bZT_MELEE;
property ZT_ALTMELEE: bZT_ALTMELEE;
Expand All @@ -158,6 +160,7 @@ class ZTMyWeapon : ZetaWeapon {
property ZT_ALTMELEECUSTOMDAMAGE: bZT_ALTMELEECUSTOMDAMAGE;

double DangerRadius;
double AltDangerRadius;
double MeleeDamage;
double AltMeleeDamage;
class<Actor> MissileType;
Expand All @@ -170,11 +173,13 @@ class ZTMyWeapon : ZetaWeapon {
double BaseRating;
double AltBaseRating;
double DangerRating;
double AltDangerRating;
double BulletSpreadH;
double AltBulletSpreadH;
double BulletSpreadV;
double AltBulletSpreadV;
double DangerFactor;
double AltDangerFactor;
string ShootSound;
string AltShootSound;
double RatingFade;
Expand All @@ -193,13 +198,16 @@ class ZTMyWeapon : ZetaWeapon {
property BaseRating: BaseRating;
property AltBaseRating: AltBaseRating;
property DangerRating: DangerRating;
property AltDangerRating: AltDangerRating;
property DangerRadius: DangerRadius;
property AltDangerRadius: AltDangerRadius;
property WeaponType: WeaponType;
property BulletSpreadH: BulletSpreadH;
property AltBulletSpreadH: AltBulletSpreadH;
property BulletSpreadV: BulletSpreadV;
property AltBulletSpreadV: AltBulletSpreadV;
property DangerFactor: DangerFactor;
property AltDangerFactor: AltDangerFactor;
property ShootSound: ShootSound;
property AltShootSound: AltShootSound;
property RatingFade: RatingFade;
Expand All @@ -209,6 +217,7 @@ class ZTMyWeapon : ZetaWeapon {

default {
ZTMyWeapon.DangerRadius 128;
ZTMyWeapon.AltDangerRadius 128;
ZTMyWeapon.MeleeDamage 3;
ZTMyWeapon.AltMeleeDamage 5;
ZTMyWeapon.MissileType "Rocket";
Expand All @@ -219,11 +228,13 @@ class ZTMyWeapon : ZetaWeapon {
ZTMyWeapon.AltBulletMaxDamage 7;
ZTMyWeapon.BaseRating 500;
ZTMyWeapon.DangerRating 300;
ZTMyWeapon.AltDangerRating 300;
ZTMyWeapon.BulletSpreadH 10;
ZTMyWeapon.AltBulletSpreadH 10;
ZTMyWeapon.BulletSpreadV 0;
ZTMyWeapon.AltBulletSpreadV 0;
ZTMyWeapon.DangerFactor 2.25;
ZTMyWeapon.DangerFactor 1.5;
ZTMyWeapon.AltDangerFactor 1.5;
ZTMyWeapon.ShootSound "";
ZTMyWeapon.AltShootSound "";
ZTMyWeapon.RatingFade 1;
Expand Down Expand Up @@ -293,18 +304,32 @@ class ZTMyWeapon : ZetaWeapon {

override double RateSelf(Actor shooter, Actor target)
{
if ( bZT_SPLASHDANGER && shooter.Distance3D(target) < DangerRadius )
return DangerRating - shooter.Distance3D(target) * DangerFactor;
if (bZT_MELEE) {
if (shooter.Distance2D(target) <= 32 + shooter.Radius + target.Radius)
return BaseRating;

return -1000;
}

if (bZT_SPLASHDANGER && shooter.Distance3D(target) < DangerRadius)
return DangerRating * ((shooter.Distance3D(target) - DangerRadius) * DangerFactor) / DangerRadius;

return BaseRating / sqrt(shooter.Distance2D(target)) / Max(1, RatingFade);
return BaseRating / sqrt(shooter.Distance2D(target) * Max(1, RatingFade));
}

override double AltRateSelf(Actor shooter, Actor target)
{
if ( bZT_SPLASHDANGER && shooter.Distance3D(target) < DangerRadius )
return DangerRating - shooter.Distance3D(target) * DangerFactor;
if (bZT_ALTMELEE) {
if (shooter.Distance2D(target) <= 32 + shooter.Radius + target.Radius)
return AltBaseRating;

return -1000;
}

if (bZT_ALTSPLASHDANGER && shooter.Distance3D(target) < AltDangerRadius)
return AltDangerRating * ((AltDangerRadius - shooter.Distance3D(target)) * AltDangerFactor) / AltDangerRadius;

return AltBaseRating / sqrt(shooter.Distance2D(target)) / Max(1, AltRatingFade);
return AltBaseRating / sqrt(shooter.Distance2D(target) * Max(1, AltRatingFade));
}

override void Fire(Actor shooter, Actor target)
Expand Down
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.7.0
VERSION=0.7.2

ADDFOLDER ZetaCode
ADDFOLDER sprites
Expand Down

0 comments on commit 9af313d

Please sign in to comment.