Пример #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 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);
}
Пример #3
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);

    }

}