Skip to content

Commit

Permalink
Bos cleanup merge7 (beyond-all-reason#3326)
Browse files Browse the repository at this point in the history
* legbar clean

* legbart clean

* legbastion clean

* legcen_clean

* legcib clean

* legdrone clean

* attack ao linewidth min clamp

* legfig_clean

* legfloat clean

* legfort clean

* leggat clean

* leggob clean
  • Loading branch information
Beherith authored Jul 5, 2024
1 parent 2b15bee commit 4b56b0f
Show file tree
Hide file tree
Showing 23 changed files with 3,529 additions and 1 deletion.
2 changes: 1 addition & 1 deletion luaui/Widgets/gui_attack_aoe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ end
--------------------------------------------------------------------------------

local function DrawAoE(tx, ty, tz, aoe, ee, alphaMult, offset, requiredEnergy)
glLineWidth(aoeLineWidthMult * aoe / mouseDistance)
glLineWidth(math.max(aoeLineWidthMult * aoe / mouseDistance, 0.5))

for i = 1, numAoECircles do
local proportion = i / (numAoECircles + 1)
Expand Down
165 changes: 165 additions & 0 deletions scripts/Units/legbar_clean.bos
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@

#include "../recoil_common_includes.h"

// Signal definitions
#define SIGNAL_MOVE 1
#define SIGNAL_AIM 2

piece base, tracks, shell, aimy1, turret, aimx1, sleeve, barrel, cover, flare;

static-var restore_delay, currentSpeed, moveSpeed;


#define TB_BASE base
#define TB_TURNRATE <15.0>
#define TB_TILT_X <0.1>
#define TB_BANK_Z <0.1> // Do not define this if you dont want banking
#include "../tilt_bank_mobileunit.h"

#define BASEPIECE base
#define HITSPEED <85.0>
//how 'heavy' the unit is, on a scale of 1-10
#define UNITSIZE 2
#define MAXTILT 100
#define RECOIL_POWER 50000
#include "../unit_hitbyweaponid_and_smoke.h"


Create()
{
hide flare;
restore_delay = 3000;
call-script TB_Init();
SLEEP_UNTIL_UNITFINISHED;
}

StartMoving(reversing)
{
signal SIGNAL_MOVE;
set-signal-mask SIGNAL_MOVE;
START_TILTBANK;
}

StopMoving()
{
signal SIGNAL_MOVE;
STOP_TILTBANK;
}

SetMaxReloadTime(reloadMS)
{
restore_delay = reloadMS * 2;
}

static-var Stunned;
ExecuteRestoreAfterDelay()
{
if (Stunned) {
return (1);
}
turn aimy1 to y-axis <0.000000> speed <90>;
turn aimx1 to x-axis <0.000000> speed <50>;
}

SetStunned(State)
{
Stunned = State;
if (!Stunned) {
start-script ExecuteRestoreAfterDelay();
}
}

RestoreAfterDelay()
{
sleep restore_delay;
start-script ExecuteRestoreAfterDelay();

move turret to y-axis [0] speed [5];
move barrel to z-axis [0] speed [15];
turn cover to x-axis <0> speed <400>;
}

AimPrimary(heading, pitch)
{
signal SIGNAL_AIM;
set-signal-mask SIGNAL_AIM;

move turret to y-axis [4] speed [10];
move barrel to z-axis [5] speed [7.5];
turn cover to x-axis <160> speed <200>;

turn aimy1 to y-axis heading speed <90.000000>;
turn aimx1 to x-axis <0.000000> - pitch speed <50.000000>;

wait-for-turn aimy1 around y-axis;
wait-for-turn aimx1 around x-axis;

start-script RestoreAfterDelay();
return (1);
}

FirePrimary()
{
emit-sfx 1024 + 0 from flare;
move barrel to z-axis [2.500000] speed [500.000000];
turn cover to x-axis <100> speed <500>;
wait-for-move barrel along z-axis;
move barrel to z-axis [5.000000] speed [3.000000];
turn cover to x-axis <160> speed <150>;
}

AimFromPrimary(piecenum)
{
piecenum = aimx1;
}

QueryPrimary(piecenum)
{
piecenum = flare;
}

SweetSpot(piecenum)
{
piecenum = turret;
}

Killed(severity, corpsetype)
{
if( severity <= 25 )
{
corpsetype = 1 ;
explode base type BITMAPONLY | NOHEATCLOUD;
explode turret type BITMAPONLY | NOHEATCLOUD;
//explode shell type BITMAPONLY | NOHEATCLOUD;
explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD;
//explode flare type BITMAPONLY | NOHEATCLOUD;
return(corpsetype);
}
if( severity <= 50 )
{
corpsetype = 2 ;
explode base type BITMAPONLY | NOHEATCLOUD;
explode turret type FALL | NOHEATCLOUD;
explode shell type FALL | NOHEATCLOUD;
explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD;
//explode flare type FIRE | SMOKE | FALL | NOHEATCLOUD;
return(corpsetype);
}
if( severity <= 99 )
{
corpsetype = 3 ;
explode base type FIRE | SMOKE | FALL | NOHEATCLOUD;
explode turret type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD;
explode shell type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD;
explode barrel type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD;
//explode flare type FIRE | SMOKE | FALL | NOHEATCLOUD;
return(corpsetype);
}
corpsetype = 3 ;
explode base type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD;
explode turret type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD;
explode shell type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD;
explode barrel type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD;
//explode flare type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD;
return corpsetype;
}
Binary file added scripts/Units/legbar_clean.cob
Binary file not shown.
657 changes: 657 additions & 0 deletions scripts/Units/legbart_clean.bos

Large diffs are not rendered by default.

Binary file added scripts/Units/legbart_clean.cob
Binary file not shown.
Loading

0 comments on commit 4b56b0f

Please sign in to comment.