Пример #1
0
bool	ArtisanManager::getRadioactiveSample(PlayerObject* player, CurrentResource* resource, SurveyTool* tool)
{
    uint32					resType			= resource->getType()->getCategoryId();
    uint16					resPE			= resource->getAttribute(ResAttr_PE);
    
    //these are the radioactive types
    if(resType == 477 || resType == 476 /* || resType == 475*/)
    {
        //did we already warn the player on the wounds ???
        if(!player->getSampleData()->mPassRadioactive)
        {
            //UI Integration

            WindowAsyncContainerCommand* asyncContainer = new  WindowAsyncContainerCommand(Window_Query_Radioactive_Sample);
            asyncContainer->PlayerId		= player->getId();
            asyncContainer->ToolId			= tool->getId();
            asyncContainer->CurrentResource	= resource;

            gUIManager->createNewMessageBox(this,"radioactiveSample","@survey:radioactive_sample_t","@survey:radioactive_sample_d",player,SUI_Window_SmplRadioactive_MsgBox, SUI_MB_YESNO,asyncContainer);
            //Pause Sampling
            player->getSampleData()->mPendingSample = false;
            return true;
        }
        Ham* hamz = player->getHam();
        uint32 playerBF = hamz->getBattleFatigue();
        
        uint32 woundDmg = 50*(1 + (playerBF/100)) + (50*(1 + (resPE/1000)));
        uint32 bfDmg    = static_cast<uint32>(0.075*resPE);
        uint32 hamReduc = 100*(2+ (resPE/1000));

        if(resPE >= 500)
        {
            //wound and BF dmg
            hamz->updateBattleFatigue(bfDmg);
            hamz->updatePropertyValue(HamBar_Health,HamProperty_Wounds, woundDmg); 
            hamz->updatePropertyValue(HamBar_Action,HamProperty_Wounds, woundDmg);
            hamz->updatePropertyValue(HamBar_Mind,HamProperty_Wounds, woundDmg);
        }
        
        //this should be a timed debuff per instance -- Do not cause wounds unless potential energy >= 500
        // each time a radioactive is sampled, there is a 5 minute debuff
        // this currently doesn't work properly as when the debuff wears off, the buff class doesn't ensure 
        // we don't have more ham than we should.
        
        BuffAttribute* healthdebuffAttribute = new BuffAttribute(attr_health, -(int)hamReduc,0,hamReduc); 
        Buff* healthdebuff = Buff::SimpleBuff(player, player, 300000,0, gWorldManager->GetCurrentGlobalTick());
        healthdebuff->AddAttribute(healthdebuffAttribute);	
        player->AddBuff(healthdebuff,true);

        healthdebuffAttribute = new BuffAttribute(attr_action, -(int)hamReduc,0,hamReduc); 
        healthdebuff = Buff::SimpleBuff(player, player, 300000, 0, gWorldManager->GetCurrentGlobalTick());
        healthdebuff->AddAttribute(healthdebuffAttribute);	
        player->AddBuff(healthdebuff,true);
    }
    else
        return false;

    return true;
}
Пример #2
0
void	CampRegion::applyHAMHealing(Object* object)
{
	PlayerObject* player = dynamic_cast<PlayerObject*>(object);

	//Make sure it's a player.
	if(player == NULL)
		return;

	Ham* hamz = player->getHam();

	//Heal the Ham
	int32 HealthRegenRate = hamz->getHealthRegenRate();
	int32 ActionRegenRate = hamz->getActionRegenRate();
	int32 MindRegenRate = hamz->getMindRegenRate();

	//Because we tick every 2 seconds, we need to double this.
	HealthRegenRate += (int32)(HealthRegenRate * mHealingModifier) * 2;
	ActionRegenRate += (int32)(ActionRegenRate * mHealingModifier) * 2;
	MindRegenRate	+= (int32)(MindRegenRate * mHealingModifier) * 2;

	if(hamz->mHealth.getModifiedHitPoints() - hamz->mHealth.getCurrentHitPoints() > 0)
	{
		//Regen Health
		int32 oldVal = hamz->mHealth.getCurrentHitPoints();
		hamz->updatePropertyValue(HamBar_Health,HamProperty_CurrentHitpoints, HealthRegenRate);
		mHealingDone += hamz->mHealth.getCurrentHitPoints() - oldVal;
	}
	
	if(hamz->mAction.getModifiedHitPoints() - hamz->mAction.getCurrentHitPoints() > 0)
	{
		//Regen Action
		int32 oldVal = hamz->mAction.getCurrentHitPoints();
		hamz->updatePropertyValue(HamBar_Action,HamProperty_CurrentHitpoints, ActionRegenRate);
		mHealingDone += hamz->mAction.getCurrentHitPoints() - oldVal;
	}

	if(hamz->mMind.getModifiedHitPoints() - hamz->mMind.getCurrentHitPoints() > 0)
	{
		//Regen Mind
		int32 oldVal = hamz->mMind.getCurrentHitPoints();
		hamz->updatePropertyValue(HamBar_Mind, HamProperty_CurrentHitpoints, MindRegenRate);
		mHealingDone += hamz->mMind.getCurrentHitPoints() - oldVal;
	}

}
Пример #3
0
void ObjectController::_handleQuickHeal(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
    PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject);
    PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic));

    //check Medic has enough Mind
    Ham* ham = Medic->getHam();
    if(ham->checkMainPools(0, 0, cmdProperties->mMindCost))
    {
        if (gMedicManager->HealDamage(Medic, Target, 0, cmdProperties, "quickHeal"))
        {
            ham->updatePropertyValue(HamBar_Focus ,HamProperty_Wounds, 10);
            ham->updatePropertyValue(HamBar_Willpower ,HamProperty_Wounds, 10);
            ham->updateBattleFatigue(2, true);
            //call the event
            gMedicManager->startQuickHealInjuryTreatmentEvent(Medic);
            return;
        }
    }
    else
        gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic);
}
Пример #4
0
void ObjectController::_handleTendWound(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
    PlayerObject* Medic = dynamic_cast<PlayerObject*>(mObject);
    PlayerObject* Target = dynamic_cast<PlayerObject*>(Medic->getHealingTarget(Medic));
    //TODO:: add medic droid
    /*EMLocationType loc = Medic->getPlayerLocation();
    if(loc != EMLocation_Cantina || loc != EMLocation_Camp || loc != EMLocation_PlayerStructure)
    {
        return;
    }*/
    std::string messageResponse = gMedicManager->handleMessage(message,"(action|constitution|health|quickness|stamina|strength)");
    if (messageResponse.length() == 0)
    {
        //you must specify a valid wound type
        gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "healing_response_65"), Medic);
    }
    else
    {
        //check Medic has enough Mind
        Ham* ham = Medic->getHam();
        if(ham->checkMainPools(0, 0, 500))
        {
            if (gMedicManager->HealWound(Medic, Target, 0, cmdProperties, messageResponse + "tendwound"))
            {
                ham->updatePropertyValue(HamBar_Focus ,HamProperty_Wounds, 5);
                ham->updatePropertyValue(HamBar_Willpower ,HamProperty_Wounds, 5);
                ham->updateBattleFatigue(2, true);
                //call the event
                gMedicManager->startWoundTreatmentEvent(Medic);
                return;
            }
        }
        else
            gMessageLib->SendSystemMessage(::common::OutOfBand("healing_response", "not_enough_mind"), Medic);

    }

}
Пример #5
0
void	CampRegion::applyWoundHealing(Object* object)
{
	PlayerObject* player = dynamic_cast<PlayerObject*>(object);

	//gLogger->logMsg("APPLYING WOUND HEALING!");

	//Make sure it's a player.
	if(player == NULL)
		return;

	Ham* hamz = player->getHam();

	if(hamz->mHealth.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Health ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mStrength.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Strength ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mConstitution.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Constitution ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mAction.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Action ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mQuickness.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Quickness ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mStamina.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Stamina ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mMind.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Mind ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mFocus.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Focus ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

	if(hamz->mWillpower.getWounds() > 0)
	{
		hamz->updatePropertyValue(HamBar_Willpower ,HamProperty_Wounds, -1);
		mHealingDone++;
	}

}