コード例 #1
0
//void CHangingLamp::Hit(float P,Fvector &dir, CObject* who,s16 element,
//					   Fvector p_in_object_space, float impulse, ALife::EHitType hit_type)
void	CHangingLamp::Hit					(SHit* pHDS)
{
	SHit	HDS = *pHDS;
	callback(GameObject::eHit)(
		lua_game_object(), 
		HDS.power,
		HDS.dir,
		smart_cast<const CGameObject*>(HDS.who)->lua_game_object(),
		HDS.bone()
		);

#ifdef HLAMP_AFFECT_IMMUNITIES
	HDS.power = CHitImmunity::AffectHit(HDS.power,HDS.hit_type);	
	inherited::Hit(pHDS);
#endif
	BOOL	bWasAlive		= Alive		() || light_render->get_active();

	if(m_pPhysicsShell) 
	   m_pPhysicsShell->applyHit(pHDS->p_in_bone_space,pHDS->dir,pHDS->impulse,pHDS->boneID,pHDS->hit_type);
	
	if (!bWasAlive) return;

	if (pHDS->boneID==light_bone)
	    SetHealth ( 0.f );
	else
	{
		float damage = pHDS->damage() * 100.f;
		Msg("DEBUG: %s health = %.3f, damage = %.3f", Name_script(), GetHealth(), damage);
		SetHealth(GetHealth() - damage);
	}
	if (bWasAlive && (!Alive()))		TurnOff	();
}
コード例 #2
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTDP_NPC_CombineS::Spawn( void )
{
	Precache();
	SetModel( STRING( GetModelName() ) );

	if( IsElite() )
	{
		// Stronger, tougher.
		SetHealth( sk_combine_guard_health.GetFloat() );
		SetMaxHealth( sk_combine_guard_health.GetFloat() );
		SetKickDamage( sk_combine_guard_kick.GetFloat() );
	}
	else
	{
		SetHealth( sk_combine_s_health.GetFloat() );
		SetMaxHealth( sk_combine_s_health.GetFloat() );
		SetKickDamage( sk_combine_s_kick.GetFloat() );
	}

	CapabilitiesAdd( bits_CAP_ANIMATEDFACE );
	CapabilitiesAdd( bits_CAP_MOVE_SHOOT );
	CapabilitiesAdd( bits_CAP_DOORS_GROUP );

	BaseClass::Spawn();
}
コード例 #3
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CNPC_CombineS::Spawn( void )
{
	Precache();
	SetModel( STRING( GetModelName() ) );

	if( IsElite() )
	{
		// Stronger, tougher.
		SetHealth( sk_combine_guard_health.GetFloat() );
		SetMaxHealth( sk_combine_guard_health.GetFloat() );
		SetKickDamage( sk_combine_guard_kick.GetFloat() );
	}
	else
	{
		SetHealth( sk_combine_s_health.GetFloat() );
		SetMaxHealth( sk_combine_s_health.GetFloat() );
		SetKickDamage( sk_combine_s_kick.GetFloat() );
	}

	CapabilitiesAdd( bits_CAP_ANIMATEDFACE );
	CapabilitiesAdd( bits_CAP_MOVE_SHOOT );
	CapabilitiesAdd( bits_CAP_DOORS_GROUP );

	BaseClass::Spawn();

#if HL2_EPISODIC
	if (m_iUseMarch && !HasSpawnFlags(SF_NPC_START_EFFICIENT))
	{
		Msg( "Soldier %s is set to use march anim, but is not an efficient AI. The blended march anim can only be used for dead-ahead walks!\n", GetDebugName() );
	}
#endif
}
コード例 #4
0
ファイル: unit.cpp プロジェクト: Fredi/Cpp
int32 Unit::ModifyHealth(int32 val)
{
    int32 gain = 0;

    if (val == 0)
        return 0;

    int32 curHealth = (int32)GetHealth();

    int32 newHealth = val + curHealth;
    if (newHealth <= 0)
    {
        SetHealth(0);
        return -curHealth;
    }

    int32 maxHealth = (int32)GetMaxHealth();

    if (newHealth < maxHealth)
    {
        SetHealth(newHealth);
        gain = newHealth - curHealth;
    }
    else if (curHealth != maxHealth)
    {
        SetHealth(maxHealth);
        gain = maxHealth - curHealth;
    }

    return gain;
}
コード例 #5
0
ファイル: Creature.cpp プロジェクト: RyanOConnor/GameEngine
Creature::Creature( const sf::Vector2f & position, CreatureType c )
	: Object( "Creature", "button.png", position, 3, 1 )
{
	creatureType = c;
	dead = false;

	strengthValues = "0123456789";

	if( creatureType == CreatureType::Dragon )
	{
		type.setString( "Dragon" );
		inStrength = rand() % 14 + 7;
		curStrength = inStrength;
		SetHealth(curStrength, inStrength);
	}
	else if( creatureType == CreatureType::Troll )
	{
		type.setString( "Troll" );
		inStrength = rand() % 14 + 7;
		curStrength = inStrength;
		SetHealth(curStrength, inStrength);
	}
	else if( creatureType == CreatureType::Skeleton )
	{
		type.setString( "Skeleton" );
		inStrength = rand() % 14 + 7;
		curStrength = inStrength;
		SetHealth(curStrength, inStrength);
	}
	else if( creatureType == CreatureType::Orc )
	{
		type.setString( "Orc" );
		inStrength = rand() % 14 + 7;
		curStrength = inStrength;
		SetHealth(curStrength, inStrength);
	}
	else if( creatureType == CreatureType::Vampire )
	{
		type.setString( "Vampire" );
		inStrength = rand() % 14 + 7;
		curStrength = inStrength;
		SetHealth(curStrength, inStrength);
	}

	font.loadFromFile("forced square.ttf");
	type.setFont( font );
	type.setCharacterSize( 52 );
	type.setColor( sf::Color(255, 51, 0) );
	type.setPosition( X(), Y() );
	sf::Vector2f t = type.findCharacterPos(8);
	type.setPosition( X() + ( 155 - ( ( t.x - X() ) / 2 ) ), Y() );

	health.setFont( font );
	health.setCharacterSize( 44 );
	health.setColor( sf::Color(80, 80, 80) );
	health.setPosition( X(), Y() );
	sf::Vector2f h = health.findCharacterPos(7);
	health.setPosition( X() + ( 155 - ( ( t.x - X() ) / 2 ) ), Y() + 92 );
}
コード例 #6
0
ファイル: asw_parasite.cpp プロジェクト: Au-heppa/swarm-sdk
void CASW_Parasite::SetHealthByDifficultyLevel()
{
	if (FClassnameIs(this, "asw_parasite_defanged"))
	{		
		SetHealth(ASWGameRules()->ModifyAlienHealthBySkillLevel(10));
	}
	else
	{
		SetHealth(ASWGameRules()->ModifyAlienHealthBySkillLevel(30));
	}
}
コード例 #7
0
ファイル: BurnBot.cpp プロジェクト: ianalcid08/FinalProject
void CBurnBot::TakeDamage(IBaseObject* _pIn)
{
	 if (_pIn->GetID() == OBJ_TURRET)
	 {
		 SetHealth(GetHealth() - ((CTurret*)_pIn)->GetDamage());
		 SetWasHit(true);
	 }
	if(((CBullet*)_pIn)->GetType() == SPECIALBULLET)
		SetHealth(0.0f);
	else
		SetHealth(GetHealth() - ((CBullet*)_pIn)->GetDamage());
	SetWasHit(true);
}
コード例 #8
0
ファイル: Boat.cpp プロジェクト: Hillvith/MCServer
cBoat::cBoat(double a_X, double a_Y, double a_Z) :
	super(etBoat, a_X, a_Y, a_Z, 0.98, 0.7)
{
	SetMass(20.f);
	SetMaxHealth(6);
	SetHealth(6);
}
コード例 #9
0
ファイル: Turtle.cpp プロジェクト: marvelman610/tmntactis
void CTurtle::Update(float fElapsedTime)
{
	m_vAnimations[m_nCurrAnimation].Update(fElapsedTime);
	if(GetExperience() >= (100 * GetLevel()))
	{
		CBattleMap::GetInstance()->PlaySFX(CAssets::GetInstance()->aBMcowabungaSnd);
		SetExperience(0/*GetExperience()-(100* GetLevel())*/);
		SetLevel(GetLevel() + 1);
		SetHealthMax((int)((float)GetMaxHealth() * 1.25f));
		SetHealth((int)((float)GetMaxHealth()));
		SetBaseAP(GetBaseAP()+2);
		SetStrength( (int)( (float)GetStrength() * 1.2f ) );
		SetDefense( (int) ( (float)GetDefense() * 1.2f ) );
		SetAccuracy( (int) ( (float)GetAccuracy() * 1.2f ) );
		SetSpeed( (int) ( (float)GetSpeed() * 1.2f ) );
	}
	if( GetHealth() <= 0)
	{
		if(GetAlive() == true)
		{
			CBattleMap::GetInstance()->DecrementNumChars();
			CBattleMap::GetInstance()->DecrementNumTurtles();
			CBattleMap::GetInstance()->SetTurtleDead();
			SetAlive(false);
			if(GetCurrAnimNum() != 9)
				SetCurrAnim(9);
			SetPosZ(0.9f);
		}
	}
}
コード例 #10
0
ファイル: unit.cpp プロジェクト: Fredi/Cpp
void Unit::SetDeathState(DeathState state)
{
    m_deathState = state;

    if (state == JUST_DIED)
        SetHealth(0);
}
コード例 #11
0
ファイル: HangingEntity.cpp プロジェクト: ChriPiv/MCServer
cHangingEntity::cHangingEntity(eEntityType a_EntityType, eBlockFace a_BlockFace, double a_X, double a_Y, double a_Z)
	: cEntity(a_EntityType, a_X, a_Y, a_Z, 0.8, 0.8)
	, m_BlockFace(a_BlockFace)
{
	SetMaxHealth(1);
	SetHealth(1);
}
コード例 #12
0
ファイル: Grunt.cpp プロジェクト: kendellm/Trials-of-Mastery
CGrunt::CGrunt(float fHealthScale) : CEnemy(20)
{
	CEntity::m_eType = ENT_ENEMY;
	SetEnemyType(Grunt);

	AnimationManager::GetInstance()->LoadAnimationFile("config/Grunt_Walk_Animation.xml");
	AnimationManager::GetInstance()->LoadAnimationFile("config/Grunt_Death_Animation.xml");
	AnimationManager::GetInstance()->LoadAnimationFile("config/Grunt_Attack_Animation.xml");
	AnimationManager::GetInstance()->LoadAnimationFile("config/Grunt_Flinch_Animation.xml");
	AnimationManager::GetInstance()->LoadAnimationFile("config/Grunt_Knocked_Down_Animation.xml");

	GetAnimInfo()->SetAnimationName("Grunt_Walk_Animation");


	SetBaseAnimations(ENT_ENEMY);

	punching = false;
	cooldown = 0.0f;
	SetHealth((int)(GetHealth()*(1.0f + fHealthScale)));

	SetIdleAnim("Grunt_Walk_Animation");

	m_bFlipped = false;
	m_fMoveAway = 0.0f;
	m_bEvadeUp = false;
	m_fPosXOld = 0.0f;
	m_fPosYOld = 0.0f;
	m_fUpdateOldPos = 0.0f;
	m_nExpPts = 50;

	CSGD_EventSystem::GetInstance()->RegisterClient("New_Player", this);
	CSGD_EventSystem::GetInstance()->RegisterClient("ModifyHealth", this);
	CSGD_EventSystem::GetInstance()->RegisterClient("Self Destruct", this);
}
コード例 #13
0
//-----------------------------------------------------------------------------
// Purpose: Touch function
//-----------------------------------------------------------------------------
bool CTFBaseDMPowerup::MyTouch( CBasePlayer *pPlayer )
{
	bool bSuccess = false;

	CTFPlayer *pTFPlayer = dynamic_cast<CTFPlayer*>( pPlayer );
	if ( pTFPlayer && ValidTouch( pPlayer ) )
	{
		// Add the condition and duration from derived classes
		pTFPlayer->m_Shared.AddCond( GetCondition(), GetEffectDuration() );

		// Give full health
		SetHealth( GetMaxHealth() );

		CSingleUserRecipientFilter user( pPlayer );
		user.MakeReliable();

		UserMessageBegin( user, "ItemPickup" );
			WRITE_STRING( GetClassname() );
		MessageEnd();

		pPlayer->EmitSound( STRING( m_strPickupSound ) );

		bSuccess = true;
	}

	return bSuccess;
}
コード例 #14
0
ファイル: HangingEntity.cpp プロジェクト: 1285done/cuberite
cHangingEntity::cHangingEntity(eEntityType a_EntityType, eBlockFace a_Facing, double a_X, double a_Y, double a_Z) :
	cEntity(a_EntityType, a_X, a_Y, a_Z, 0.8, 0.8),
	m_Facing(cHangingEntity::BlockFaceToProtocolFace(a_Facing))
{
	SetMaxHealth(1);
	SetHealth(1);
}
コード例 #15
0
ファイル: Creature.cpp プロジェクト: chrayn/mangos-06
void Creature::SelectLevel(const CreatureInfo *cinfo)
{
    uint32 minlevel = min(cinfo->maxlevel, cinfo->minlevel);
    uint32 maxlevel = max(cinfo->maxlevel, cinfo->minlevel);
    uint32 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel);
    SetLevel(level);

    float rellevel = maxlevel == minlevel ? 0 : (float(level - minlevel))/(maxlevel - minlevel);

    uint32 minhealth = min(cinfo->maxhealth, cinfo->minhealth);
    uint32 maxhealth = max(cinfo->maxhealth, cinfo->minhealth);
    uint32 health = uint32(_GetHealthMod(isPet() ? 0 : cinfo->rank) * (minhealth + uint32(rellevel*(maxhealth - minhealth))));

    SetMaxHealth(health);
    SetUInt32Value(UNIT_FIELD_BASE_HEALTH,health);
    SetHealth(health);

    uint32 minmana = min(cinfo->maxmana, cinfo->minmana);
    uint32 maxmana = max(cinfo->maxmana, cinfo->minmana);
    uint32 mana = minmana + uint32(rellevel*(maxmana - minmana));

    SetMaxPower(POWER_MANA, mana);                          //MAX Mana
    SetUInt32Value(UNIT_FIELD_BASE_MANA, mana);
    SetPower(POWER_MANA, mana);
}
コード例 #16
0
ファイル: Mech_RPGCharacter.cpp プロジェクト: belven/Mech_RPG
void AMech_RPGCharacter::Reset()
{
	if (GetCurrentWeapon() != nullptr) {
		GetCurrentWeapon()->Destroy();
		SetCurrentWeapon(nullptr);
	}

	abilities.Empty();
	armour.Empty();

	if (GetInventory() != nullptr) {
		GetInventory()->GetItems().Empty();
	}

	inventory = NewObject<UInventory>(UInventory::StaticClass());

	SetHealth(GetMaxHealth());

	channeling = false;
	inCombat = false;

	canAttack = 0;
	canMove = 0;
	canBeDamaged = 0;
}
コード例 #17
0
bool Vehicle::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 vehicleId, uint32 team)
{
    SetMapId(map->GetId());
    SetInstanceId(map->GetInstanceId());

    Object::_Create(guidlow, Entry, HIGHGUID_VEHICLE);

    if(!InitEntry(Entry, team))
        return false;

    m_defaultMovementType = IDLE_MOTION_TYPE;

    AIM_Initialize();

    SetVehicleId(vehicleId);

    SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
    SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);

    CreatureInfo const *ci = GetCreatureInfo();
    setFaction(team == ALLIANCE ? ci->faction_A : ci->faction_H);
    SetMaxHealth(ci->maxhealth);
    SelectLevel(ci);
    SetHealth(GetMaxHealth());

	for( int i = 0; i < 4; ++i )
		this->m_spells[i] = this->GetCreatureInfo()->spells[i]; // So our vehicles can have spells on bar
	GetMotionMaster()->MovePoint(0, GetPositionX(), GetPositionY(), GetPositionZ()+2 ); // So we can fly with Dragon Vehicles

    return true;
}
コード例 #18
0
ファイル: CCruiser.cpp プロジェクト: UCLanGroup/GameProject
CCruiser::CCruiser(std::vector<CPlayer*>* players, BulletList* playerBullets, BulletList* enemyBullets) : CEnemy(players, playerBullets, enemyBullets)
{
	SetMesh(HAVOC_BOSS_MESH);

	//Ensure model is reset in the case it reuses a cached model
	mModel->ResetScale();
	mModel->ResetOrientation();

	mModel->RotateY(180.0f);

	mWeapon.reset(new CMissileBarrage(this, 10, 75.0f, 0.1f));
	mWeapon->SetBulletList(enemyBullets);
	mWeapon->SetEnemyBulletList(playerBullets);
	mWeapon->SetFiring(false);

	/*if (static_cast<int>(players->size()) > 0)
	{
		mWeapon->SetTarget((*players)[0]);
	}*/

	SetHealth(25);
	SetRadius(kRadius);
	SetValue(50);
	SetSpeed(30.0f);
	mStateTimer = 0.0f;
	mState = State::Enter;
}
コード例 #19
0
ファイル: Vehicle.cpp プロジェクト: Aemu/mangos
bool Vehicle::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 vehicleId, uint32 team)
{
    SetMapId(map->GetId());
    SetInstanceId(map->GetInstanceId());

    Object::_Create(guidlow, Entry, HIGHGUID_VEHICLE);

    if(!InitEntry(Entry, team))
        return false;

    m_defaultMovementType = IDLE_MOTION_TYPE;

    AIM_Initialize();

    SetVehicleId(vehicleId);

    SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
    SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);

    CreatureInfo const *ci = GetCreatureInfo();
    setFaction(team == ALLIANCE ? ci->faction_A : ci->faction_H);
    SetMaxHealth(ci->maxhealth);
    SelectLevel(ci);
    SetHealth(GetMaxHealth());

    return true;
}
コード例 #20
0
ファイル: player.cpp プロジェクト: Serebriakov/premake
void Player::Initialize(const glm::vec2 &StartPosition)
{
	if( m_Sprite->GetRenderState() == NULL )
	{
		m_Sprite->SetRenderState(GLESRenderer::Instance()->AddRenderState(RenderState(GLESRenderer::Instance()->GetShader("tiles"), RenderState::BLENDING_ENABLED)));
	}

	m_Hitbox.m_Position = StartPosition - glm::vec2(m_Hitbox.m_Size.x / 2.f, m_Hitbox.m_Size.y);
	m_Velocity = glm::vec2(0, 0);
	m_IsOnGround = false;
	m_IsPressingDown = false;

	ReleaseWeapons();
	LoadWeapon("data/weapons/1/weapon1.json");
	LoadWeapon("data/weapons/2/weapon2.json");

	m_CurrentWeaponIndex = 0;

	SetState(IDLE);

	SetScore(0);
	SetHealth(3);
	m_Energy = 3;
	for( size_t i = 0; i < HUD::NUMBER_OF_LETTERS; ++i )
	{
		m_BonusLetters[i] = false;
	}
}
コード例 #21
0
ファイル: Wither.cpp プロジェクト: ThuGie/MCServer
cWither::cWither(void) :
	super("Wither", mtWither, "entity.wither.hurt", "entity.wither.death", 0.9, 4.0),
	m_WitherInvulnerableTicks(220)
{
	SetMaxHealth(300);
	SetHealth(GetMaxHealth() / 3);
}
コード例 #22
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CWeaponStriderBuster::Spawn( void )
{	
	SetModelName( AllocPooledString("models/magnusson_device.mdl") );
	BaseClass::Spawn();
	
	// Setup for being shot by the player
	m_takedamage = DAMAGE_EVENTS_ONLY;

	// Ignore touches until launched.
	SetTouch ( NULL );

	AddFlag( FL_AIMTARGET|FL_OBJECT );

	m_hParticleEffect = CreateEntityByName( "info_particle_system" );
	if ( m_hParticleEffect )
	{
		m_hParticleEffect->KeyValue( "start_active", "1" );
		m_hParticleEffect->KeyValue( "effect_name", "striderbuster_smoke" );
		DispatchSpawn( m_hParticleEffect );
		if ( gpGlobals->curtime > 0.2f )
		{
			m_hParticleEffect->Activate();
		}
		m_hParticleEffect->SetAbsOrigin( GetAbsOrigin() );
		m_hParticleEffect->SetParent( this );
	}

	SetHealth( striderbuster_health.GetFloat() );
	
	SetNextThink(gpGlobals->curtime + 0.01f);
}
コード例 #23
0
//====================================================================
// Creación en el mapa
//====================================================================
void CAP_PlayerInfected::Spawn()
{
	ConVarRef infected_health("sk_infected_health");
	int iMaxHealth = infected_health.GetInt() + RandomInt( 1, 5 );

	CB_MeleeCharacter::SetOuter( this );
	BaseClass::Spawn();

	// El Director será el responsable de crearnos
	// Mientras tanto seremos invisibles y no nos moveremos
	AddEffects( EF_NODRAW );
	AddFlag( FL_FREEZING );
	SetCollisionGroup( COLLISION_GROUP_NONE );
	m_takedamage = DAMAGE_NO;

	// Esto hará que el Director lo tome como uno de sus hijos
	SetName( AllocPooledString(DIRECTOR_CHILD_NAME) );

	// Seleccionamos un color para nuestra ropa
	SetClothColor();

	// Establecemos la salud
	SetMaxHealth( iMaxHealth );
	SetHealth( iMaxHealth );

	// Más información
	m_iNextIdleSound	= IDLE_SOUND_INTERVAL;
	m_iNextAttack		= ATTACK_INTERVAL;

	// Solicitamos un lugar para el Spawn
	RegisterThinkContext( "RequestDirectorSpawn" );
	SetContextThink( &CAP_PlayerInfected::RequestDirectorSpawn, gpGlobals->curtime, "RequestDirectorSpawn" );
}
コード例 #24
0
ファイル: Totem.cpp プロジェクト: AwkwardDev/MangosFX
void Totem::Summon(Unit* owner)
{
	if(!owner)
		return;

	// Mana Tide Totem should have 10% of caster's health
	if(GetSpell() == 16191)
	{
		SetMaxHealth(owner->GetMaxHealth()*10/100);
		SetHealth(GetMaxHealth());
	}

    owner->GetMap()->Add((Creature*)this);

    AIM_Initialize();

    // there are some totems, which exist just for their visual appeareance
    if (!GetSpell())
        return;

    switch(m_type)
    {
        case TOTEM_PASSIVE:
            CastSpell(this, GetSpell(), true);
            break;
        case TOTEM_STATUE:
            CastSpell(GetOwner(), GetSpell(), true);
            break;
        default: break;
    }
}
コード例 #25
0
ファイル: Creature.cpp プロジェクト: RyanOConnor/GameEngine
void Creature::Update()
{
	sf::Vector2i mousePosition = 
		sf::Mouse::getPosition( *SFMLGame::GetInstance()->GetWindow() );

	bool isInBounds =
	    ( mousePosition.x >= X() ) && 
		( mousePosition.x < ( X() + SpriteWidth() ) ) &&
		( mousePosition.y >= Y() ) &&
		( mousePosition.y < ( Y() + SpriteHeight() ) );

	if (isInBounds && sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
	{
		view = true;
	}

	if (curStrength <= 0)
	{
		dead = true;
	}

	SetHealth(curStrength, inStrength);

	Object::Update();
}
コード例 #26
0
ファイル: Wither.cpp プロジェクト: FX-Master/MCServer
bool cWither::Initialize(cWorld * a_World)
{
	// Set health before BroadcastSpawnEntity()
	SetHealth(GetMaxHealth() / 3);

	return super::Initialize(a_World);
}
コード例 #27
0
ファイル: asw_ranger.cpp プロジェクト: Cre3per/hl2sdk-csgo
//-----------------------------------------------------------------------------
// Purpose:	
// Input:	
// Output:	
//-----------------------------------------------------------------------------
void CASW_Ranger::SetHealthByDifficultyLevel()
{
	int iHealth = MAX( 25, ASWGameRules()->ModifyAlienHealthBySkillLevel( asw_ranger_health.GetInt() ) );
	if ( asw_debug_alien_damage.GetBool() )
		Msg( "Setting ranger's initial health to %d\n", iHealth );
	SetHealth( iHealth );
	SetMaxHealth( iHealth );
}
コード例 #28
0
ファイル: Actor.cpp プロジェクト: Shane-S/COMP8851-Assign3
void Actor::Reset(Vector2 pos)
{
	SetPosition(pos);
	SetHealth(100);
	SetActorXDirection(_startXDir);
	SetActorYDirection(_startYDir);
	_aabb.UpdatePosition(*this);
}
コード例 #29
0
ファイル: Player.cpp プロジェクト: dahin/fefu-mmorpg
Player::Player()
{
  type_ = EActorType::PLAYER;
  SetRace();
  SetMaxHealth(1000);
  SetHealth(1000);
  SetBlows();
}
コード例 #30
0
void HealthComponent::SetMaxHealth(float maxHealth, bool scaleHealth) {
	ASSERT_GT(maxHealth, 0.0f);

	healthLogger.Debug("Changing maximum health: %3.1f → %3.1f.", this->maxHealth, maxHealth);

	HealthComponent::maxHealth = maxHealth;
	if (scaleHealth) SetHealth(health * (this->maxHealth / maxHealth));
}