mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 23:21:35 +00:00
96 lines
2.2 KiB
Text
96 lines
2.2 KiB
Text
/***********************************************************************
|
|
|
|
weapon_bloodstone_active1.script
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
// blend times
|
|
#define BLOODSTONE_ACTIVE1_IDLE_TO_LOWER 4
|
|
#define BLOODSTONE_ACTIVE1_IDLE_TO_FIRE 4
|
|
#define BLOODSTONE_ACTIVE1_RAISE_TO_IDLE 4
|
|
#define BLOODSTONE_ACTIVE1_FIRE_TO_IDLE 4
|
|
|
|
object weapon_bloodstone_active1 : weapon_base {
|
|
|
|
|
|
void init();
|
|
|
|
void ToActive2();
|
|
|
|
void Lower();
|
|
void Raise();
|
|
void Idle();
|
|
void Fire();
|
|
};
|
|
|
|
void weapon_bloodstone_active1::init() {
|
|
weaponState( "Raise", 0 );
|
|
}
|
|
|
|
void weapon_bloodstone_active1::Raise() {
|
|
|
|
string prevWeaponName;
|
|
|
|
weaponRising();
|
|
prevWeaponName = $player1.getPreviousWeapon();
|
|
|
|
if(prevWeaponName == "weapon_bloodstone_passive") {
|
|
playAnim( ANIMCHANNEL_ALL, "passivetoone" );
|
|
} else {
|
|
playAnim( ANIMCHANNEL_ALL, "raise" );
|
|
}
|
|
waitUntil( animDone( ANIMCHANNEL_ALL, BLOODSTONE_ACTIVE1_RAISE_TO_IDLE ) );
|
|
weaponState( "Idle", BLOODSTONE_ACTIVE1_RAISE_TO_IDLE );
|
|
}
|
|
|
|
void weapon_bloodstone_active1::ToActive2() {
|
|
weaponLowering();
|
|
weaponHolstered();
|
|
waitUntil( WEAPON_RAISEWEAPON );
|
|
weaponState( "Raise", 0 );
|
|
}
|
|
|
|
void weapon_bloodstone_active1::Lower() {
|
|
weaponLowering();
|
|
playAnim( ANIMCHANNEL_ALL, "putaway" );
|
|
waitUntil( animDone( ANIMCHANNEL_ALL, 0 ) );
|
|
weaponHolstered();
|
|
waitUntil( WEAPON_RAISEWEAPON );
|
|
weaponState( "Raise", 0 );
|
|
}
|
|
|
|
void weapon_bloodstone_active1::Idle() {
|
|
string nextWeaponName;
|
|
|
|
weaponReady();
|
|
playCycle( ANIMCHANNEL_ALL, "idle" );
|
|
while( 1 ) {
|
|
if ( WEAPON_LOWERWEAPON ) {
|
|
|
|
nextWeaponName = $player1.getIdealWeapon();
|
|
if(nextWeaponName == "weapon_bloodstone_active2") {
|
|
weaponState( "ToActive2", 0 );
|
|
} else {
|
|
weaponState( "Lower", BLOODSTONE_ACTIVE1_IDLE_TO_LOWER );
|
|
}
|
|
|
|
}
|
|
if ( WEAPON_ATTACK ) {
|
|
weaponState( "Fire", BLOODSTONE_ACTIVE1_IDLE_TO_FIRE );
|
|
}
|
|
waitFrame();
|
|
}
|
|
}
|
|
|
|
void weapon_bloodstone_active1::Fire() {
|
|
|
|
launchPowerup("helltime", 10, 1);
|
|
sys.wait(1);
|
|
|
|
//playAnim( ANIMCHANNEL_ALL, "fire" );
|
|
//while( !animDone( ANIMCHANNEL_ALL, BLOODSTONE_ACTIVE1_FIRE_TO_IDLE ) ) {
|
|
// waitFrame();
|
|
//}
|
|
weaponState( "Idle", BLOODSTONE_ACTIVE1_FIRE_TO_IDLE );
|
|
}
|