//----------------------------------------------------------------------------- // Purpose: // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CWeaponGrapple::Deploy(void) { if (m_bMustReload) { return DefaultDeploy((char*)GetViewModel(), (char*)GetWorldModel(), ACT_CROSSBOW_DRAW_UNLOADED, (char*)GetAnimPrefix()); } SetSkin(BOLT_SKIN_GLOW); return BaseClass::Deploy(); }
bool CWeapon_SLAM::Deploy( void ) { CBaseCombatCharacter *pOwner = GetOwner(); if (!pOwner) { return false; } m_bDetonatorArmed = AnyUndetonatedCharges(); SetThink( SLAMThink ); SetNextThink( gpGlobals->curtime + 0.1f ); SetModel( GetViewModel() ); // ------------------------------ // Pick the right draw animation // ------------------------------ int iActivity; // If detonator is already armed m_bNeedReload = false; if (m_bDetonatorArmed) { if (pOwner->GetAmmoCount(m_iSecondaryAmmoType) <= 0) { iActivity = ACT_SLAM_DETONATOR_DRAW; m_bNeedReload = true; } else if (CanAttachSLAM()) { iActivity = ACT_SLAM_DETONATOR_STICKWALL_DRAW; } else { iActivity = ACT_SLAM_DETONATOR_THROW_DRAW; } } else { if (CanAttachSLAM()) { iActivity = ACT_SLAM_STICKWALL_ND_DRAW; } else { iActivity = ACT_SLAM_THROW_ND_DRAW; } } return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), iActivity, (char*)GetAnimPrefix() ); }
//----------------------------------------------------------------------------- // Purpose: // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CBaseHL2MPCombatWeapon::Deploy( void ) { // If we should be lowered, deploy in the lowered position // We have to ask the player if the last time it checked, the weapon was lowered if ( GetOwner() && GetOwner()->IsPlayer() ) { CHL2MP_Player *pPlayer = assert_cast<CHL2MP_Player*>( GetOwner() ); if ( pPlayer->IsWeaponLowered() ) { if ( SelectWeightedSequence( ACT_VM_IDLE_LOWERED ) != ACTIVITY_NOT_AVAILABLE ) { if ( DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_VM_IDLE_LOWERED, (char*)GetAnimPrefix() ) ) { m_bLowered = true; // Stomp the next attack time to fix the fact that the lower idles are long pPlayer->SetNextAttack( gpGlobals->curtime + 1.0 ); m_flNextPrimaryAttack = gpGlobals->curtime + 1.0; m_flNextSecondaryAttack = gpGlobals->curtime + 1.0; return true; } } } } m_bLowered = false; return BaseClass::Deploy(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CWeaponBuilder::Deploy( ) { #if !defined( CLIENT_DLL ) if ( m_hObjectBeingBuilt.Get() && m_hObjectBeingBuilt->IsAnUpgrade() ) return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_SLAM_STICKWALL_ND_DRAW, (char*)GetAnimPrefix() ); return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_VM_DRAW, (char*)GetAnimPrefix() ); #else return true; #endif }
//----------------------------------------------------------------------------- // Purpose: // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CWeaponCrossbow::Deploy( void ) { if ( m_iClip1 <= 0 ) { return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_CROSSBOW_DRAW_UNLOADED, (char*)GetAnimPrefix() ); } SetSkin( BOLT_SKIN_GLOW ); return BaseClass::Deploy(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- bool CWeaponMortar::Deploy( ) { return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_SLAM_TRIPMINE_DRAW, (char*)GetAnimPrefix() ); }
bool CWeapon_Tripwire::Deploy( void ) { CBaseCombatCharacter *pOwner = GetOwner(); if (!pOwner) { return false; } SetModel( GetViewModel() ); // ------------------------------ // Pick the right draw animation // ------------------------------ int iActivity; // If detonator is already armed m_bNeedReload = false; iActivity = ACT_SLAM_STICKWALL_ND_DRAW; return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), iActivity, (char*)GetAnimPrefix() ); }
bool CDODBaseRocketWeapon::Deploy( ) { return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), GetDrawActivity(), (char*)GetAnimPrefix() ); }
bool CWeaponFlowerLauncher::Deploy( void ) { if ( m_iClip1 <= 0 ) return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_CROSSBOW_DRAW_UNLOADED, (char*)GetAnimPrefix() ); return BaseClass::Deploy(); }
bool CWeaponMine::Deploy( void ) { m_bNeedReload = false; return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_SLAM_TRIPMINE_DRAW, (char*)GetAnimPrefix() ); }
//------------------------------------------------------------------------------ // Purpose : // Input : // Output : //------------------------------------------------------------------------------ bool CWeaponBrickbat::Deploy( void ) { SetModel( GetViewModel() ); m_bNeedDraw = false; m_bNeedThrow = false; return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), ACT_VM_DRAW, (char*)GetAnimPrefix() ); }
bool CWeapon_Manhack::Deploy( void ) { CBasePlayer *pOwner = ToBasePlayer( GetOwner() ); if ( !pOwner ) { return false; } // ------------------------------ // Pick the right draw animation // ------------------------------ int iActivity; m_bHasFreeSlot = HasFreeSlot(); bool bNoDrivable = true; CPropVehicleManhack *pManhack = CPropVehicleManhack::GetManhackVehicle(); if (pManhack) //m_hManhack) { // = dynamic_cast<CPropVehicleManhack*>((CBaseEntity*)m_hManhack); if (pManhack->HasDrivableManhack(pOwner)) { bNoDrivable = false; } } if ( m_bHasAmmo && m_bHasFreeSlot && (!m_bIsDoingController || bNoDrivable)) { iActivity = ACT_VM_DRAW; //EnableManhackSubModel(true); CBasePlayer *pPlayer = ToBasePlayer( pOwner ); if ( pPlayer != NULL) m_bIsDoingController = false; m_bSpawnSomeMore = true; //TERO: not sure about this } else { m_bIsDoingController = true; m_bSpawnSomeMore = false; iActivity = ACT_SLAM_DETONATOR_DRAW; } m_bIsDrawing=true; m_bShouldShowPanel = true; //TERO: this next bit is to make sure the player gets the right hint message if the controllable state has changed if (GlobalEntity_GetState("manhacks_not_controllable") == GLOBAL_ON ) { if (m_bHadControllable) { m_iManhackHintTimeShown=0; CBasePlayer *pPlayer = ToBasePlayer( pOwner ); if ( pPlayer != NULL && (CPropVehicleManhack::GetManhackVehicle() != NULL) ) { UTIL_HudHintText( pPlayer, "#HLSS_Hint_ManhackSend" ); m_iManhackHintTimeShown++; } } m_bHadControllable = false; } else { if (!m_bHadControllable) { m_iManhackHintTimeShown=0; CBasePlayer *pPlayer = ToBasePlayer( pOwner ); if ( pPlayer != NULL && (CPropVehicleManhack::GetManhackVehicle() != NULL) ) { UTIL_HudHintText( pPlayer, "#HLSS_Hint_ManhackControl" ); m_iManhackHintTimeShown++; } } m_bHadControllable = true; } if (!m_hScreen) { /*CBaseViewModel *vm = pOwner->GetViewModel( m_nViewModelIndex ); if (vm) { //vm->SpawnControlPanels(); int nLLAttachmentIndex = vm->LookupAttachment("controlpanel0_ll"); int nURAttachmentIndex = vm->LookupAttachment("controlpanel0_ur"); matrix3x4_t panelToWorld; vm->GetAttachment( nLLAttachmentIndex, panelToWorld ); matrix3x4_t worldToPanel; MatrixInvert( panelToWorld, worldToPanel ); // Now get the lower right position + transform into panel space Vector lr, lrlocal; vm->GetAttachment( nURAttachmentIndex, panelToWorld ); MatrixGetColumn( panelToWorld, 3, lr ); VectorTransform( lr, worldToPanel, lrlocal ); float flWidth = lrlocal.x; float flHeight = lrlocal.y; CVGuiScreen *pScreen = CreateVGuiScreen( "vgui_screen", "manhack_screen", this, this, 0 ); pScreen->ChangeTeam( 69 ); pScreen->SetActualSize( 128, 64 ); pScreen->SetActive( true ); pScreen->MakeVisibleOnlyToTeammates( true ); pScreen->SetAttachedToViewModel(true); m_hScreen.Set( pScreen ); }*/ CVGuiScreen *pScreen = CreateVGuiScreen( "vgui_screen", "manhack_screen", this, this, 0 ); //pScreen->SetActualSize( 128, 64 ); pScreen->SetActive( true ); pScreen->MakeVisibleOnlyToTeammates( true ); pScreen->SetAttachedToViewModel(true); m_hScreen.Set( pScreen ); } return DefaultDeploy( (char*)GetViewModel(), (char*)GetWorldModel(), iActivity, (char*)GetAnimPrefix() ); }