コード例 #1
0
TESForm * AddItemHealthPercentOwner(TESObjectREFR* thisObj, UInt32 refID, SInt32 NumItems, float Health, TESForm* pOwner, UInt32 Rank)
{
	if (!thisObj) return NULL;

	TESForm * pForm = LookupFormByID(refID);
	if (!pForm) return NULL;
	TESHealthForm* pHealth = DYNAMIC_CAST(pForm, TESForm, TESHealthForm);
	if (!pHealth && (Health != -1.0)) {
		_MESSAGE("\t\tInventoryInfo\t\tAddItemHealthPercentOwner:\tInvalid refID:%#10X, no health attribute", thisObj->refID);
		return NULL;
	}
	TESScriptableForm* pScript = DYNAMIC_CAST(pForm, TESForm, TESScriptableForm);
	if (pScript && !pScript->script) pScript = NULL;  // Only existing scripts matter

	ExtraHealth* pXHealth = NULL;
	ExtraOwnership* pXOwner = NULL;
	ExtraRank* pXRank = NULL;
	ExtraCount* pXCount = NULL;
	ExtraDataList* pExtraDataList = NULL;
	ExtraScript * pXScript = NULL;

	if (!(1.0 == Health) || pOwner || Rank || pScript) {
		pExtraDataList = ExtraDataList::Create();
		if (!(1.0 == Health)) {
			pXHealth = ExtraHealth::Create();
			if (!pExtraDataList->Add(pXHealth))
				FormHeap_Free(pXHealth);
			else
				pXHealth->health = pHealth->GetHealth() * Health;
		}
		if (pOwner) {
			pXOwner = ExtraOwnership::Create();
			if (!pExtraDataList->Add(pXOwner))
				FormHeap_Free(pXOwner);
			else
				pXOwner->owner = pOwner;
		}
		if (Rank) {
			pXRank = ExtraRank::Create();
			if (!pExtraDataList->Add(pXRank))
				FormHeap_Free(pXRank);
			else
				pXRank->rank = Rank;
		}
		if (pScript) {
			pXScript = ExtraScript::Create(pForm, true);
			if (!pExtraDataList->Add(pXScript))
				FormHeap_Free(pXScript);
		}
	}
	thisObj->AddItem(pForm, pExtraDataList, NumItems);
	return pForm;
}
コード例 #2
0
	void SetGoldValue(TESForm* thisForm, UInt32 value)
	{
		if (!thisForm)
			return;
		TESValueForm* pValue = DYNAMIC_CAST(thisForm, TESForm, TESValueForm);
		if (pValue)
			pValue->value = value;
		else {
			AlchemyItem* alchemyItem = DYNAMIC_CAST(thisForm, TESForm, AlchemyItem);
			if(alchemyItem && (alchemyItem->itemData.flags & AlchemyItem::kFlag_ManualCalc) == AlchemyItem::kFlag_ManualCalc)
				alchemyItem->itemData.value = value;
		}
	}
コード例 #3
0
ファイル: stepA_mal.cpp プロジェクト: 1989tianlong/mal
static const malLambda* isMacroApplication(malValuePtr obj, malEnvPtr env)
{
    if (const malSequence* seq = isPair(obj)) {
        if (malSymbol* sym = DYNAMIC_CAST(malSymbol, seq->first())) {
            if (malEnvPtr symEnv = env->find(sym->value())) {
                malValuePtr value = sym->eval(symEnv);
                if (malLambda* lambda = DYNAMIC_CAST(malLambda, value)) {
                    return lambda->isMacro() ? lambda : NULL;
                }
            }
        }
    }
    return NULL;
}
コード例 #4
0
	UInt32 GetValue(TESForm* thisForm)
	{
		if (!thisForm)
			return 0;
		TESValueForm* pValue = DYNAMIC_CAST(thisForm, TESForm, TESValueForm);
		if (pValue)
			return pValue->value;
		else {
			AlchemyItem* alchemyItem = DYNAMIC_CAST(thisForm, TESForm, AlchemyItem);
			if(alchemyItem && (alchemyItem->itemData.flags & AlchemyItem::kFlag_ManualCalc) == AlchemyItem::kFlag_ManualCalc)
				return alchemyItem->itemData.value;
		}
		return 0;
	}
コード例 #5
0
	VMResultArray<TESObjectREFR*> getActiveDisplays(StaticFunctionTag*, BSFixedString characterName)
	{
		VMResultArray<TESObjectREFR*> results;
		Json::Value jsonDisplayList = ReadDisplayData();

		for (auto & jsonDisplay : jsonDisplayList.getMemberNames()) 
		{
			TESObjectREFR* displayObj = DYNAMIC_CAST(GetJCStringForm(jsonDisplay), TESForm, TESObjectREFR);
			
			if (strlen(characterName.data))
			{
				for (auto & contributor : jsonDisplayList[jsonDisplay.c_str()]["contributors"])
				{
					if (contributor.asString() == characterName.data)
						results.push_back(displayObj);
				}
			} 
			else 
			{
				results.push_back(displayObj);
			}
		}
		
		return results;
	}
コード例 #6
0
	void ShootingAttacker::AimAndShoot()
	{
		auto settings = DYNAMIC_CAST(m_Settings, ShootingAttackerSettings);

		// aim
		Vector3 vPosition = GetAbsolutePosition();
		Vector3 vAimDirection = (m_ShootTarget->GetAbsolutePosition() - vPosition).Normalize();		
		m_vLookAt = Math::Damp(m_vLookAt, vAimDirection, g_fDeltaTime, settings->m_fLookAtDuration);
		LookAt(m_vLookAt);

		// shoot
		if(m_fShootTimer < 0.0f)
		{
			Bullet::BulletParams params;
			Vector3 vBulletLocalPos = GetRotationMatrix().TransformVect(m_vBulletOffset);

			params.vPosition = vPosition + vBulletLocalPos;
			params.vDirection = vAimDirection;
			params.fSpeed = m_fBulletSpeed;
			params.fLife = m_fBulletLife;
			params.fRadius = m_fBulletSize/2.0f;
			params.damage = settings->m_fBulletDamage;

			SFXMGR->GetEnemyPulseManager()->AddBullet(params);
			AUDIOMGR->Play(AudioManager::S_EnemyPulse);

			m_fShootTimer = m_fBulletFrequency;
		}

		m_fShootTimer -= g_fDeltaTime;
	}	
コード例 #7
0
	bool HasItemAbility(Actor * actor, TESForm* baseForm, BaseExtraList * extraData)
	{
		if(actor && baseForm) {
			tList<ActiveEffect> * effects = actor->magicTarget.GetActiveEffects();
			for(UInt32 i = 0; i < effects->Count(); i++) {
				ActiveEffect* effect = effects->GetNthItem(i);
				if(effect->sourceItem == baseForm) { // Check the item
					EnchantmentItem * enchantment = NULL;
					TESEnchantableForm * enchantable = DYNAMIC_CAST(baseForm, TESForm, TESEnchantableForm);
					if(enchantable) { // Check the item for a base enchantment
						enchantment = enchantable->enchantment;
					}
					if(extraData) { // Check the extra data for enchantment
						ExtraEnchantment* extraEnchant = static_cast<ExtraEnchantment*>(extraData->GetByType(kExtraData_Enchantment));
						if(extraEnchant) {
							enchantment = extraEnchant->enchant;
						}
					}

					if(effect->item == enchantment) {
						return true;
					}
				}
			}
		}

		return false;
	}
コード例 #8
0
bool Cmd_SetPackageTargetReference_Execute(COMMAND_ARGS)
{
	*result = 0;

	//DEBUG_MESSAGE("\t\tSPT @\n");
	TESObjectREFR* pRefr = NULL;
	TESForm * pForm = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pForm, &pRefr);
	if (!pRefr)
		if(!thisObj)
			return true;
		else
			pRefr = thisObj;
	//DEBUG_MESSAGE("\t\tSPT 0 Refr:[%08X]\n", pRefr->refID);
	if (!pForm)
			return true;
	//DEBUG_MESSAGE("\t\tSPT 1 Form:0x%x Refr:[%08X]\n", pForm, pRefr->refID);
	pPackage = DYNAMIC_CAST(pForm, TESForm, TESPackage);
	//DEBUG_MESSAGE("\t\tSPT 2 Package:0x%x Refr:[%08X]\n", pPackage, pRefr->refID);
	if (pPackage) {
		//if (pPackage->target)
		//	DEBUG_MESSAGE("target is %s", pPackage->target->StringForTargetCodeAndData());
		//DEBUG_MESSAGE("\t\tSPT 3 Package:[%08X] Refr:[%08X] Target:0x%x\n", pPackage->refID, pRefr->refID, pPackage->target);
		pPackage->SetTarget(pRefr);
		//DEBUG_MESSAGE("\t\tSPT 4 Package:[%08X] Refr:[%08X] Target:0x%x\n", pPackage->refID, pRefr->refID, pPackage->target);
		//if (pPackage->target)
		//	DEBUG_MESSAGE("target is %s", pPackage->target->StringForTargetCodeAndData());
	}
	return true;
}
コード例 #9
0
bool Cmd_GetPackageLocation_Execute(COMMAND_ARGS)
{
	*result = 0;
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;

	//DEBUG_MESSAGE("\t\tSPL @\n");
	TESForm * pForm = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pForm);
	if (!pForm)
		return true;
	//DEBUG_MESSAGE("\t\tGPL 1 Package:[%x]\n", pForm);
	pPackage = DYNAMIC_CAST(pForm, TESForm, TESPackage);
	//DEBUG_MESSAGE("\t\tGPL 2 Package:[%x]\n", pPackage);
	if (pPackage && pPackage->location) {
		//DEBUG_MESSAGE("\t\tGPL 3 Package:%x\n", pPackage->refID);
		TESPackage::LocationData * pLocation = pPackage->GetLocationData();
		//DEBUG_MESSAGE("\t\GSPL 4 Package:%x Location:[%x]\n", pPackage->refID, pLocation);
		if (pLocation && pLocation->object.form)
			switch (pLocation->locationType) {
				case TESPackage::LocationData::kPackLocation_NearReference:
				case TESPackage::LocationData::kPackLocation_InCell:
				case TESPackage::LocationData::kPackLocation_ObjectID:
					*refResult = pLocation->object.form->refID;
					break;
				case TESPackage::LocationData::kPackLocation_ObjectType:
					*refResult = pLocation->object.objectCode;
					break;
		}

			//DEBUG_MESSAGE("\t\tSPL 5 Package:%x Location:[%x]\n", pPackage->refID, *refResult);
	}
	return true;
}
コード例 #10
0
bool Cmd_SetTexturePath_Execute(COMMAND_ARGS)
{
	*result = 0;
	ExpressionEvaluator eval(PASS_COMMAND_ARGS);
	if (eval.ExtractArgs() && eval.NumArgs() > 0) {
		TESForm* form = NULL;
		if (eval.NumArgs() == 2) {
			form = eval.Arg(1)->GetTESForm();
		}
		else if (thisObj) {
			form = thisObj->baseForm;
		}

		TESTexture* tex = DYNAMIC_CAST(form, TESForm, TESTexture);
		if (tex) {
			const char* nuPath = eval.Arg(0)->GetString();
			if (nuPath) {
				tex->ddsPath.Set(nuPath);
				*result = 1;
			}
		}
	}

	return true;
}
コード例 #11
0
void TESObjectARMA::GetNodeName(char * dstBuff, TESObjectREFR * refr, TESObjectARMO * armor, float weightOverride)
{
	float weight = 100.0;
	TESNPC * npc = DYNAMIC_CAST(refr->baseForm, TESForm, TESNPC);
	if(npc && npc->nextTemplate) {
		TESNPC * temp = npc->GetRootTemplate();
		if(temp) {
			weight = temp->weight;
		}
	}
	else
		weight = CALL_MEMBER_FN(refr, GetWeight)();

	weight /= 100.0;
	if(weightOverride >= 0.0) // Determines whether to factor weight into the name, -1 true, 1 false
		weight = weightOverride;

	weight *= 100.0;
	
	UInt32 sex = npc ? CALL_MEMBER_FN(npc, GetSex)() : 0;
	/*sprintf_s(dstBuff, MAX_PATH, "%s (%08X)[%d]/%s (%08X) [%2.0f%%]", 
		this->Unk_32(), // I really have no idea why they used a string here for a boolean value, probably legacy code
		this->formID,
		sex,
		armor->Unk_32(), 
		armor->formID, 
		weight);*/
	sprintf_s(dstBuff, MAX_PATH, " (%08X)[%d]/ (%08X) [%2.0f%%]", 
		this->formID,
		sex,
		armor->formID, 
		weight);
}
コード例 #12
0
	bool IsValidEntry(TESContainer::Entry* pEntry, SInt32& numObjects)
	{
		if (pEntry) {
			numObjects = pEntry->count;
			TESForm* pForm = pEntry->form;

			if (DYNAMIC_CAST(pForm, TESForm, TESLevItem))
				return false;

			ExtraContainerMap::iterator it = m_map.find(pForm);
			ExtraContainerMap::iterator itEnd = m_map.end();
			if (it != itEnd) {
				UInt32 index = it->second;
				ExtraContainerChanges::EntryData* pXData = m_vec[index];
				if (pXData) {
					numObjects += pXData->countDelta;
				}
				// clear the object from the vector so we don't bother to look for it
				// in the second step
				m_vec[index] = NULL;
			}

			if (numObjects > 0) {
				//if (IsConsoleMode()) {
				//	PrintItemType(pForm);
				//}
				return true;
			}
		}
		return false;
	}
コード例 #13
0
	UInt32 GetNumItems(TESObjectREFR* pContainerRef)
	{
		if (!pContainerRef)
			return 0;

		TESContainer* pContainer = NULL;
		TESForm* pBaseForm = pContainerRef->baseForm;
		if (pBaseForm) {
			pContainer = DYNAMIC_CAST(pBaseForm, TESForm, TESContainer);
		}
		if (!pContainer)
			return 0;

		UInt32 count = 0;
			
		ExtraContainerChanges* pXContainerChanges = static_cast<ExtraContainerChanges*>(pContainerRef->extraData.GetByType(kExtraData_ContainerChanges));
		ExtraContainerInfo info(pXContainerChanges ? pXContainerChanges->data->objList : NULL);


		// first walk the base container
		if (pContainer) {
			ContainerCountIf counter(info);
			count = pContainer->CountIf(counter);
		}

		// now count the remaining items
		count += info.CountItems();

		return count;
	}
コード例 #14
0
	//! visits a particular entity
	void ParticleVisitor::Visit(Entity* pTarget)
	{
		SHOOT_ASSERT(pTarget->IsA(ParticleGenerator::TypeID), "ParticleVisitor target is not of type ParticleGenerator");
		if(ParticleGenerator* pEmitter = DYNAMIC_CAST(pTarget, ParticleGenerator))		
			pEmitter->SetActive(m_bEmitterActive);
		super::Visit(pTarget);		
	}	
コード例 #15
0
bool Cmd_GetCurrentPackage_Execute(COMMAND_ARGS)
{
	*result = 0;
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;

	//DEBUG_MESSAGE("\t\tGCP @\n");
	TESObjectREFR* pRefr = NULL;
	Actor * pActor = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pRefr);
	if (!pRefr)
		if(!thisObj)
			return true;
		else
			pRefr = thisObj;
	//DEBUG_MESSAGE("\t\tGCP 0 Refr:%x\n", pRefr->refID);
	pActor = DYNAMIC_CAST(pRefr, TESObjectREFR, Actor);
	if (!pActor || !pActor->baseProcess)
			return true;
	//DEBUG_MESSAGE("\t\tGCP 1 Package:[%x] Refr:%x\n", pForm, pRefr->refID);
	pPackage = pActor->baseProcess->GetCurrentPackage();
	//DEBUG_MESSAGE("\t\tGCP 2 Package:[%x] Refr:%x\n", pPackage, pRefr->refID);
	if (pPackage) {
		*refResult = pPackage->refID;
		//DEBUG_MESSAGE("\t\tGCP 3 Package:%x  Refr:%x\n", *refResult, pRefr->refID);
	}
	if (IsConsoleMode())
		Console_Print("GetCurrentPackage >> [%08X] ", *result);
	return true;
}
コード例 #16
0
bool Cmd_GetScopeModelPath_Execute(COMMAND_ARGS)
{
	TESForm* form = NULL;
	TESModel* model = NULL;
	const char* pathStr = "";
	*result = 0;

	if (ExtractArgsEx(EXTRACT_ARGS_EX, &form))
	{
		if (!form)
			if (thisObj)
				form = thisObj->baseForm;

		TESObjectWEAP* weapon = DYNAMIC_CAST(form, TESForm, TESObjectWEAP);
		if (weapon && weapon->HasScope())
			model = &(weapon->targetNIF);

		if (model)
			pathStr = model->nifPath.m_data;
	}

	AssignToStringVar(PASS_COMMAND_ARGS, pathStr);

	return true;
}
コード例 #17
0
bool Cmd_SetPackageLocationReference_Execute(COMMAND_ARGS)
{
	*result = 0;

	//DEBUG_MESSAGE("\t\tSPL @\n");
	TESObjectREFR* pRefr = NULL;
	TESForm * pForm = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pForm, &pRefr);
	if (!pRefr)
		if(!thisObj)
			return true;
		else
			pRefr = thisObj;
	//DEBUG_MESSAGE("\t\tSPL 0 Refr:%x\n", pRefr->refID);
	if (!pForm)
		return true;
	//DEBUG_MESSAGE("\t\tSPL 1 Package:[%x] Refr:%x\n", pForm, pRefr->refID);
	pPackage = DYNAMIC_CAST(pForm, TESForm, TESPackage);
	//DEBUG_MESSAGE("\t\tSPL 2 Package:[%x] Refr:%x\n", pPackage, pRefr->refID);
	if (pPackage) {
		//DEBUG_MESSAGE("\t\tSPL 3 Package:%x Refr:%x\n", pPackage->refID, pRefr->refID);
		TESPackage::LocationData * pLocation = pPackage->GetLocationData();
		//DEBUG_MESSAGE("\t\tSPL 4 Package:%x Refr:%x Location:[%x]\n", pPackage->refID, pRefr->refID, pLocation);
		if (pLocation) {
			pLocation->locationType = TESPackage::LocationData::kPackLocation_NearReference;
			pLocation->object.form = pRefr;

			//DEBUG_MESSAGE("\t\tSPL 5 Package:%x Refr:%x Location:[%x]\n", pPackage->refID, pRefr->refID, pLocation);
		}
	}
	return true;
}
コード例 #18
0
EventResult TESEquipEventHandler::ReceiveEvent(TESEquipEvent* evn, EventDispatcher<TESEquipEvent>* dispatcher)
{
	if (evn->actor->baseForm != (*g_thePlayer)->baseForm)
		return kEvent_Continue;

	TESForm* equippedForm = LookupFormByID(evn->equippedFormID);

	EnchantmentItem* enchantment = DYNAMIC_CAST(equippedForm, TESForm, EnchantmentItem);

	if (!enchantment) //check active effects to see if an armor enchantment was equipped
	{
		if (evn->isEquipping)
			g_activeEnchantEffects.ProcessEquipped(); //find new equipped enchanted item and send event to papyrus
		else //unequipping
			g_activeEnchantEffects.ProcessUnequipped(); //find removed enchanted item and send event to papyrus
	}

	else if (enchantment->data.unk14 != 0x0C) //weapon enchantment equipped (but ignore staff enchantments for now)
	{
		if (evn->isEquipping)
			playerEquippedWeaponEnchantments.Push(evn->equippedFormID);
		else
			playerEquippedWeaponEnchantments.Pop(evn->equippedFormID);

		g_userExclusions.UpdateWeaponExclusions();

		g_hitEventExDispatcher->RemoveEventSink(&g_hitEventExHandler);
		if (playerEquippedWeaponEnchantments.HasData())
			g_hitEventExDispatcher->AddEventSink(&g_hitEventExHandler);
	}

	return kEvent_Continue;
}
コード例 #19
0
bool Cmd_SetPackageLocationRadius_Execute(COMMAND_ARGS)
{
	*result = 0;

	//DEBUG_MESSAGE("\t\tSPLR @\n");
	float aRadius = 0.0;
	TESForm * pForm = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pForm, &aRadius);
	//DEBUG_MESSAGE("\t\tSPLR 0 aRadius:%f\n", aRadius);
	if (!pForm)
		return true;
	//DEBUG_MESSAGE("\t\tSPLR 1 Form:0x%08x aRadius:%f\n", pForm, aRadius);
	pPackage = DYNAMIC_CAST(pForm, TESForm, TESPackage);
	//DEBUG_MESSAGE("\t\tSPLR 2 Package:0x%08x aRadius:%f\n", pPackage, aRadius);
	if (pPackage && pPackage->location) {
		//DEBUG_MESSAGE("\t\tSPLR 3 Package:[%08X] aRadius:%f\n", pPackage->refID, aRadius);
		TESPackage::LocationData * pLocation = pPackage->GetLocationData();
		//DEBUG_MESSAGE("\t\tSPLR 4 Package:%x Refr:%x Location:[%x]\n", pPackage->refID, pForm->refID, pLocation);
		if (pLocation) {
			pLocation->radius = aRadius;

			//DEBUG_MESSAGE("\t\tSPLR 5 Package:%x Refr:%x Location:[%x] radius=%d\n", pPackage->refID, pForm->refID, pLocation, pLocation->radius);
		}
	}
	return true;
}
コード例 #20
0
bool Actor::VisitFactions(FactionVisitor & visitor)
{
	TESNPC* npc = DYNAMIC_CAST(baseForm, TESForm, TESNPC);
	if(npc) {
		for(UInt32 i = 0; i < npc->actorData.factions.count; i++)
		{
			TESActorBaseData::FactionInfo info;
			npc->actorData.factions.GetNthItem(i, info);
			if(visitor.Accept(info.faction, info.rank))
				return true;
		}

		ExtraFactionChanges* pFactionChanges = static_cast<ExtraFactionChanges*>(extraData.GetByType(kExtraData_FactionChanges));
		if (pFactionChanges) {
			for(UInt32 i = 0; i < pFactionChanges->factions.count; i++)
			{
				ExtraFactionChanges::FactionInfo info;
				pFactionChanges->factions.GetNthItem(i, info);
				if(visitor.Accept(info.faction, info.rank))
					return true;
			}
		}
	}

	return false;
}
コード例 #21
0
	void QueueNiNodeUpdate(Actor* thisActor)
	{
		Character * pChar = DYNAMIC_CAST(thisActor, Actor, Character);
		if(pChar) {
			CALL_MEMBER_FN(pChar, QueueNiNodeUpdate)(false); // False makes this allow weapons to not be auto holstered apparently
		}
	}
コード例 #22
0
//
//  Method name : operator==
//  Description : Compares two constants for equality.
//
bool
CJavaIntegerConstant::operator==(const CJavaConstant& other) const
{
  CJavaIntegerConstant* otherClass =
    DYNAMIC_CAST(CJavaIntegerConstant, &other);
  return otherClass != 0 && fInteger == otherClass->fInteger;
}
コード例 #23
0
	void SetName(TESForm* thisForm, BSFixedString nuName)
	{
		TESFullName* pFullName = DYNAMIC_CAST(thisForm, TESForm, TESFullName);
		// is a const string, so have to just reassign it.
		if (pFullName) {
			pFullName->name = nuName;
		}
	}
コード例 #24
0
//
//  Method name : operator==
//  Description : Compares two constants for equality.
//
bool
CJavaMethodConstant::operator==(const CJavaConstant& other) const
{
  CJavaMethodConstant* otherClass = DYNAMIC_CAST(CJavaMethodConstant, &other);
  return otherClass != 0 &&
    fClassIndex == otherClass->fClassIndex &&
    fNameTypeIndex == otherClass->fNameTypeIndex;
}
コード例 #25
0
ファイル: stepA_mal.cpp プロジェクト: 1989tianlong/mal
malValuePtr APPLY(malValuePtr op, malValueIter argsBegin, malValueIter argsEnd)
{
    const malApplicable* handler = DYNAMIC_CAST(malApplicable, op);
    MAL_CHECK(handler != NULL,
              "\"%s\" is not applicable", op->print(true).c_str());

    return handler->apply(argsBegin, argsEnd);
}
コード例 #26
0
	void SetWorldModelPath(TESForm * thisForm, BSFixedString nuPath)
	{
		if(thisForm) {
			TESModel* pWorldModel = DYNAMIC_CAST(thisForm, TESForm, TESModel);
			if(pWorldModel)
				pWorldModel->SetModelName(nuPath.data);
		}
	}
コード例 #27
0
bool Cmd_GetPackageCount_Eval(COMMAND_ARGS_EVAL)
{
	*result = 0;
	UInt32* intResult = (UInt32*)result;
	TESAIForm* pAI = NULL;

	Actor* pActor = DYNAMIC_CAST(thisObj, TESForm, Actor);
	if (pActor)
		pAI = DYNAMIC_CAST(pActor->baseForm, TESForm, TESAIForm);
	if (pAI) {
		*result = pAI->GetPackageCount();
		//DEBUG_MESSAGE("\t\tGPC E Actor:%x AI:[%#10x] intResult:[%0.f]\n", pActor->refID, pAI, *result);
	}
	if (IsConsoleMode())
		Console_Print("GetPackageCount >> %u", *intResult);
	return true;
}
コード例 #28
0
ファイル: nvse_extender.cpp プロジェクト: ashmedai/NVSE
bool Cmd_NX_IsUsingSkeleton_Execute(COMMAND_ARGS)
{
  TESActorBase *pActor;
  char skelName[512];
  char actorModel[512];
  char *pch    = NULL;
  char *dummy = NULL;
  char **parts = NULL;
  int  cnt     = 0;
  int  idx;

  _MESSAGE("START IsUsingSkeleton");

  *result = 0;

  if (ExtractArgs(EXTRACT_ARGS, &skelName))
  {
    pActor = DYNAMIC_CAST(thisObj->baseForm, TESForm, TESActorBase);
    if (pActor)
    {
      strcpy_s(actorModel, 512, pActor->model.GetPath());
      pch = strtok_s(actorModel, "/\\", &dummy);
      while (NULL != pch)
      {
        parts = (char **) realloc(parts, (cnt + 1) * (sizeof(char*)));
        parts[cnt] = pch;
        cnt++;
        pch = strtok_s(NULL, "/\\", &dummy);
      }

      for (idx = 0; idx < cnt; idx++)
      {
        _MESSAGE("IDX %d is %s", idx, parts[idx]);
      }

      if (cnt >= 2)
      {
        _MESSAGE("SIC %s %s is %d", skelName, parts[cnt - 2], _stricmp(skelName, parts[cnt - 2]));

        if (0 == _stricmp(skelName, parts[cnt - 2]))
        {
          *result = 1;
        }
      }

      // Free our memory
      free(parts);

      if (IsConsoleMode())
      {
        Console_Print("IsUsingSkeleton %.0f", *result);
      }
    }
  }

  _MESSAGE("END IsUsingSkeleton %0.0f", *result);
  return true;
}
コード例 #29
0
//
//  Method name : operator==
//  Description : Compares two constants for equality.
//
bool
CJavaNameTypeConstant::operator==(const CJavaConstant& other) const
{
  CJavaNameTypeConstant* otherClass =
    DYNAMIC_CAST(CJavaNameTypeConstant, &other);
  return otherClass != 0 &&
    fNameIndex == otherClass->fNameIndex &&
    fSignatureIndex == otherClass->fSignatureIndex;
}
コード例 #30
0
	bool Matches(TESForm* pForm) const {
		if (pForm) {
			BGSBipedObjectForm* pBip = DYNAMIC_CAST(pForm, TESForm, BGSBipedObjectForm);
			if (pBip) {
				return (pBip->data.parts & m_mask) != 0;
			}
		}
		return false;
	}