void Player::RemoveHull(float hull_dmg, Object *mob)
{
    float hull = ShipIndex()->GetHullPoints() - hull_dmg;

    ShipIndex()->SetHullPoints(hull);

    //If we have used all of the hull, the player goes BOOM!
    if (hull <= 0.0f)
    {
        ShipIndex()->SetHullPoints(0);
        ShipIndex()->SetIsIncapacitated(true);

		if(GetCurrentSkill())
		{
			GetCurrentSkill()->InterruptSkillOnAction(INCAPACITATE);
		}

		// Break formation/Leave Formation if in group
		if (GroupID() != -1)
		{
			g_PlayerMgr->BreakFormation(GameID());
			g_PlayerMgr->LeaveFormation(GameID());
		}

		// Stop regen
		RemoveEnergy(0);
		ShipIndex()->Shield.SetStartValue(GetShield());
		ShipIndex()->Shield.SetEndTime(GetNet7TickCount());		// Set end time now!

        ImmobilisePlayer();
        TerminateWarp();    //This sends the packet (TODO: Remove packet send from here)

		// Send Data
		SendAuxShip();

		//now deselect player's target - this causes the immobilisation to occur
		UnSetTarget(-1);

        //Stop any mobs from attacking
		//ObjectManager *om = GetObjectManager();
        //if (om) om->RemovePlayerFromMOBRangeLists(this);
        if (mob && mob->HostilityTarget() == this->GameID())
        {
            mob->LostTarget(this);
        }

        m_Mutex.Lock();

        Player *p = (0);

		while (g_PlayerMgr->GetNextPlayerOnList(p, m_RangeList))
		{
            p->PointEffect(Position(), 1017);
        }

        m_Mutex.Unlock();
    }
}
Esempio n. 2
0
bool Game_Actor::HasHalfSpCost() const {
	auto checkEquip = [](const RPG::Item* item) {
		return item && item->half_sp_cost;
	};
	return checkEquip(GetShield())
		|| checkEquip(GetArmor())
		|| checkEquip(GetHelmet())
		|| checkEquip(GetAccessory());
}
Esempio n. 3
0
bool Game_Actor::HasPhysicalEvasionUp() const {
	auto checkEquip = [](const RPG::Item* item) {
		return item && item->raise_evasion;
	};
	return checkEquip(GetShield())
		|| checkEquip(GetArmor())
		|| checkEquip(GetHelmet())
		|| checkEquip(GetAccessory());
}
Esempio n. 4
0
bool Game_Actor::PreventsTerrainDamage() const {
	auto checkEquip = [](const RPG::Item* item) {
		return item && item->no_terrain_damage;
	};
	return checkEquip(GetShield())
		|| checkEquip(GetArmor())
		|| checkEquip(GetHelmet())
		|| checkEquip(GetAccessory());
}
Esempio n. 5
0
bool Game_Actor::PreventsCritical() const {
	auto checkEquip = [](const RPG::Item* item) {
		return item && item->prevent_critical;
	};
	return checkEquip(GetShield())
		|| checkEquip(GetArmor())
		|| checkEquip(GetHelmet())
		|| checkEquip(GetAccessory());
}
Esempio n. 6
0
int Robot::DMGDispose(int vary)
{
	if (GetShield())
	{
		VaryShield(-1);
		godmode = true;
		godtimer = 250;
		return 0;
	}
	return GameObject::DMGDispose(vary);
}
Esempio n. 7
0
void Game_Actor::AddEquipmentStates() {
	if (!Player::IsRPG2k3()) {
		return;
	}

	auto checkEquip = [this](const RPG::Item* item) {
		if (item && item->state_effect) {
			for (int i = 0; i < (int)item->state_set.size(); i++) {
				if (item->state_set[i]) {
					AddState(i + 1);
				}
			}
		}
	};
	checkEquip(GetShield());
	checkEquip(GetArmor());
	checkEquip(GetHelmet());
	checkEquip(GetAccessory());
}