本文整理汇总了C++中nlmisc::CSheetId类的典型用法代码示例。如果您正苦于以下问题:C++ CSheetId类的具体用法?C++ CSheetId怎么用?C++ CSheetId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSheetId类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: isUserColorSupported
//-----------------------------------------------
// isUserColorSupported :
// Test whether user color is supported for this equipment
//-----------------------------------------------
bool isUserColorSupported(const CPlayerSheet::CEquipment &equip)
{
NLMISC::CSheetId si;
if(!si.buildSheetId(equip.Item))
return false;
CItemSheet *is = dynamic_cast<CItemSheet *>(SheetMngr.get(si));
if(!is)
return false;
return is->Color == -1; // user color supported by the item
}// isUserColorSupported //
开发者ID:AzyxWare,项目名称:ryzom,代码行数:16,代码来源:misc.cpp
示例2: addSound
void CSoundAnimMarker::addSound(const NLMISC::CSheetId& soundName)
{
pair<TMarkerSoundSet::iterator, bool> inserted;
inserted = _Sounds.insert(soundName);
if (inserted.second == false)
{
nlwarning("Duplicate sound (%s)",/* CStringMapper::unmap(soundName).c_str()*/soundName.toString().c_str());
}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:9,代码来源:sound_anim_marker.cpp
示例3: getColor
//-----------------------------------------------
// getColor :
//-----------------------------------------------
sint8 getColor(const CPlayerSheet::CEquipment &equip)
{
NLMISC::CSheetId si;
if(!si.buildSheetId(equip.Item))
return -2;
CItemSheet *is = dynamic_cast<CItemSheet *>(SheetMngr.get(si));
if(!is)
return -2;
if(is->Color == -1) // user color supported by the item
{
return equip.Color;
}
else
{
return is->Color;
}
}// getColor //
开发者ID:AzyxWare,项目名称:ryzom,代码行数:22,代码来源:misc.cpp
示例4: getVSIndex
//=======================================================================
sint CSheetManager::getVSIndex(const std::string &itemName, SLOTTYPE::EVisualSlot slot)
{
NLMISC::CSheetId si;
if (!si.buildSheetId(itemName))
{
nlwarning("<CSheetManager::getVSIndex> : cannot build id from item %s for the slot %d.", itemName.c_str(), slot);
return -1;
}
TEntitySheetMap::iterator it = _EntitySheetContainer.find(si);;
if (it == _EntitySheetContainer.end())
{
nlwarning("<CSheetManager::getVSIndex> : cannot find %s for the slot %d.", itemName.c_str(), slot);
return -1;
}
if (it->second.EntitySheet == 0 || it->second.EntitySheet->type() != CEntitySheet::ITEM)
{
nlwarning("<CSheetManager::getVSIndex> : %s is not an item for the slot %d.", itemName.c_str(), slot);
return -1;
}
CItemSheet *is = static_cast<CItemSheet *>(it->second.EntitySheet);
const TVisualSlotItemArray *ia = getVSItems(is);
if (ia == NULL)
{
nlwarning("<CSheetManager::getVSIndex> : no items for the slot %d. while looking for %s", slot, itemName.c_str());
return -1;
}
TVisualSlotItemArray::const_iterator first(ia->begin()), last(ia->end());
for(; first != last; ++first)
{
if (first->first == slot)
{
return first->second;
}
}
nlwarning("<CSheetManager::getVSIndex> : cannot find %s for the slot %d.", itemName.c_str(), slot);
return -1;
}
开发者ID:mixxit,项目名称:solinia,代码行数:43,代码来源:sheet_manager.cpp
示例5: removeSound
void CSoundAnimMarker::removeSound(const NLMISC::CSheetId &soundName)
{
TMarkerSoundSet::iterator iter = _Sounds.find(soundName);
if (iter != _Sounds.end())
{
_Sounds.erase(iter);
}
else
{
nlwarning("No sound was removed (%s)", soundName.toString().c_str()/*CStringMapper::unmap(soundName).c_str()*/);
}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:12,代码来源:sound_anim_marker.cpp
示例6: isSheetClient
bool CRingAccess::isSheetClient(const NLMISC::CSheetId& sheet) const
{
static const std::string racesStr[] = { "matis_", "fyros_", "tryker_", "zorai_"};
static const uint32 racesLen[] = { 6, 6, 7 ,6 };
static const std::string sexsStr[] = { "male", "female"};
static const uint32 sexsLen[] = { 4, 6};
static const std::string basic = "basic_";
static const uint32 basicLength = 6;
std::string sheetStr = sheet.toString();
uint32 sheetLength = (uint32)sheetStr.length();
if (sheetLength >= basicLength && sheetStr.substr(0, basicLength) == basic)
{
// good thing is a basic_* something
for (uint32 i = 0; i < 4 ; ++i)
{
const uint32 raceLength = racesLen[i];
if ( sheetLength > basicLength + raceLength && sheetStr.substr(basicLength, raceLength) == racesStr[i])
{
// good thing is a basic_race_
for (uint32 j = 0; j < 2 ; ++j)
{
uint32 sexLength = sexsLen[j];
if (sheetLength > basicLength + raceLength + sexLength && sheetStr.substr(basicLength + raceLength, sexLength) == sexsStr[j])
{
return true;
}
}
}
}
}
return false;
}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:40,代码来源:ring_access.cpp
示例7: spawn
/*
* Spawn the source as an entity in mirror. Return false in case of failure.
*/
bool CToxicCloud::spawn( const NLMISC::CSheetId &sheet )
{
// Add into mirror
CEntityId entityId = CEntityId::getNewEntityId( RYZOMID::fx_entity );
if ( ! Mirror.createEntity( entityId ) )
return false;
_DataSetRow = TheDataset.getDataSetRow( entityId );
// Set the sheet id
CMirrorPropValue<TYPE_SHEET> sheetMirror( TheDataset, _DataSetRow, DSPropertySHEET );
sheetMirror = sheet.asInt();
// Set the initial position
CMirrorPropValue<TYPE_POSX> posX( TheDataset, _DataSetRow, DSPropertyPOSX );
CMirrorPropValue<TYPE_POSY> posY( TheDataset, _DataSetRow, DSPropertyPOSY );
posX = (TYPE_POSX)(_Pos.x * 1000.0f);
posY = (TYPE_POSY)(_Pos.y * 1000.0f);
// Set the mode
MBEHAV::TMode md;
md.setModeAndPos( MBEHAV::NORMAL, _DataSetRow );
CMirrorPropValue<MBEHAV::TMode> mode( TheDataset, _DataSetRow, DSPropertyMODE );
mode = md;
// Set the WhoSeesMe bitfield (every bit set to 1)
const uint64 bitfield = IsRingShard? R2_VISION::buildWhoSeesMe(R2_VISION::WHOSEESME_VISIBLE_PLAYER,true): UINT64_CONSTANT(0xffffffffffffffff);
CMirrorPropValue<TYPE_WHO_SEES_ME> whoSeesMe(TheDataset, _DataSetRow, DSPropertyWHO_SEES_ME );
whoSeesMe = bitfield;
// Contextual properties init
CMirrorPropValue<TYPE_CONTEXTUAL> contextualProperties(TheDataset, _DataSetRow, DSPropertyCONTEXTUAL );
contextualProperties = 0;
TheDataset.declareEntity( _DataSetRow );
return true;
}
开发者ID:mixxit,项目名称:solinia,代码行数:39,代码来源:toxic_cloud.cpp
示例8: initSheetServer
void CMirrors::initSheetServer( const TDataSetRow& entityIndex, const NLMISC::CSheetId& sheetId )
{
nlassert(sheetId != NLMISC::CSheetId::Unknown);
CMirrorPropValue<TYPE_SHEET> value( *DataSet, entityIndex, DSPropertySHEET_SERVER );
value = sheetId.asInt();
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:6,代码来源:mirrors.cpp
示例9: initSheet
void CMirrors::initSheet( const TDataSetRow& entityIndex, const NLMISC::CSheetId& sheetId )
{
CMirrorPropValue<TYPE_SHEET> value( *DataSet, entityIndex, DSPropertySHEET );
value = sheetId.asInt();
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:5,代码来源:mirrors.cpp
示例10: cloneEntityIntoScenario
//.........这里部分代码省略.........
{
nlwarning("Can't find DB leaf %s", propNameC.c_str());
return "";
}
vA.PropertyA = leafA->getValue64();
vB.PropertyB = leafB->getValue64();
vC.PropertyC = leafC->getValue64();
nlassert(desc->isTable());
CObjectTable *props = (CObjectTable *) desc.get();
props->set("GabaritHeight", (double)vC.PropertySubData.CharacterHeight);
props->set("GabaritTorsoWidth", (double)vC.PropertySubData.TorsoWidth);
props->set("GabaritArmsWidth", (double)vC.PropertySubData.ArmsWidth);
props->set("GabaritLegsWidth", (double)vC.PropertySubData.LegsWidth);
props->set("GabaritBreastSize", (double)vC.PropertySubData.BreastSize);
props->set("HairColor", (double)vA.PropertySubData.HatColor);
props->set("Tattoo", (double)vC.PropertySubData.Tattoo);
props->set("EyesColor", (double)vC.PropertySubData.EyesColor);
props->set("MorphTarget1", (double)vC.PropertySubData.MorphTarget1);
props->set("MorphTarget2", (double)vC.PropertySubData.MorphTarget2);
props->set("MorphTarget3", (double)vC.PropertySubData.MorphTarget3);
props->set("MorphTarget4", (double)vC.PropertySubData.MorphTarget4);
props->set("MorphTarget5", (double)vC.PropertySubData.MorphTarget5);
props->set("MorphTarget6", (double)vC.PropertySubData.MorphTarget6);
props->set("MorphTarget7", (double)vC.PropertySubData.MorphTarget7);
props->set("MorphTarget8", (double)vC.PropertySubData.MorphTarget8);
props->set("Sex", (double)vA.PropertySubData.Sex);
CVisualSlotManager * vsManager = CVisualSlotManager::getInstance();
NLMISC::CSheetId * sheetId = NULL;
if(vA.PropertySubData.HatModel == 0)
{
props->set("HatModel", 0);
}
else
{
sheetId = vsManager->index2Sheet((uint32)vA.PropertySubData.HatModel, SLOTTYPE::HEAD_SLOT);
if (sheetId)
{
props->set("HairType", (double)sheetId->asInt());
}
}
if(vA.PropertySubData.JacketModel == 0)
{
props->set("JacketModel", 0);
}
else
{
sheetId = vsManager->index2Sheet((uint32)vA.PropertySubData.JacketModel, SLOTTYPE::CHEST_SLOT);
if (sheetId)
{
props->set("JacketModel", (double)sheetId->asInt());
}
}
if(vA.PropertySubData.TrouserModel == 0)
{
props->set("TrouserModel", 0);
}
else
开发者ID:mixxit,项目名称:solinia,代码行数:67,代码来源:tool_create_entity.cpp
示例11: createSystemCraftedItem
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// create a system crafted item
static CGameItemPtr createSystemCraftedItem( uint16 quantity, const NLMISC::CSheetId& sheet )
{
if (quantity == 0) return NULL;
// if quantity > 1, check if item is stackable and check stack quantity
if (quantity > 1)
{
const CStaticItem* form = CSheets::getForm( sheet );
if( form )
{
if( form->Stackable < quantity )
{
quantity = (uint16) form->Stackable;
}
}
else
{
nlwarning("<CFaberActionCommon::createACraftedItem> can't found form for item %s", sheet.toString().c_str());
}
}
if (quantity > 1)
{
CSheetId idSheetStack("stack.sitem");
CGameItemPtr stackItem = GameItemManager.createItem( idSheetStack, (uint16)1, CEntityId::Unknown, (sint16)0, false, CEntityId::Unknown );
if( stackItem == NULL )
{
nlwarning("<CFaberActionCommon::createACraftedItem> Error while creating stack bag %s -> returned a NULL pointer", idSheetStack.toString().c_str() );
return NULL;
}
else
{
uint32 hp = 0;
uint32 hpmax = 0;
for( int q = 0; q < quantity; ++q )
{
CGameItemPtr itemTmp = GameItemManager.createItem( const_cast< CSheetId& > ( sheet ), 1, const_cast<NLMISC::CEntityId&>(stackItem->getId()), (sint16)-1, true, CEntityId::Unknown );
if (!hp && itemTmp != NULL)
{
hp = itemTmp->hp();
hpmax = itemTmp->standardHP();
}
}
return stackItem;
}
}
else // do not create a stack, as there is only one object
{
CGameItemPtr item = GameItemManager.createItem( const_cast< CSheetId& > ( sheet ), (uint16)1, CEntityId::Unknown, (sint16)0, true, CEntityId::Unknown );
if( item == NULL)
{
nlwarning("<CFaberActionCommon::createACraftedItem> Error while creating item %s -> returned a NULL pointer", sheet.toString().c_str() );
return NULL;
}
return item;
}
} // createSystemCraftedItem //
开发者ID:Kiddinglife,项目名称:ryzom,代码行数:59,代码来源:faber_action.cpp
示例12: readGeorges
//-----------------------------------------------
// CStaticLightCycle readGeorges
//-----------------------------------------------
void CStaticLightCycle::readGeorges( const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const NLMISC::CSheetId &sheetId )
{
if( form )
{
UFormElm& root = form->getRootNode();
vector< string > season;
season.push_back( string("Spring") );
season.push_back( string("Summer") );
season.push_back( string("Autumn") );
season.push_back( string("Winter") );
uint NbSeasons = 4;
LightCycles.resize( NbSeasons );
for( uint i = 0; i < NbSeasons; ++i )
{
UFormElm* SeasonElt = NULL;
if( ! ( root.getNodeByName( &SeasonElt, season[ i ].c_str() ) && SeasonElt ) )
{
nlwarning("<CStaticLightCycle readGeorges> can get node %s in sheet %s", season[ i ].c_str(), sheetId.toString().c_str() );
}
else
{
// Day hour
if( ! SeasonElt->getValueByName( LightCycles[ i ].DayHour, "DayHour" ) )
{
nlwarning("<CStaticLightCycle readGeorges> can get value DayHour in node %d on SeasonElt structure in sheet %s", i, sheetId.toString().c_str() );
}
// Day to dusk hour
if( ! SeasonElt->getValueByName( LightCycles[ i ].DayToDuskHour, "DayToDuskHour" ) )
{
nlwarning("<CStaticLightCycle readGeorges> can get value DayToDuskHour in node %d on SeasonElt structure in sheet %s", i, sheetId.toString().c_str() );
}
// Dusk to night hour
if( ! SeasonElt->getValueByName( LightCycles[ i ].DuskToNightHour, "DuskToNightHour" ) )
{
nlwarning("<CStaticLightCycle readGeorges> can get value DuskToNightHour in node %d on SeasonElt structure in sheet %s", i, sheetId.toString().c_str() );
}
// Night hour
if( ! SeasonElt->getValueByName( LightCycles[ i ].NightHour, "NightHour" ) )
{
nlwarning("<CStaticLightCycle readGeorges> can get value NightHour in node %d on SeasonElt structure in sheet %s", i, sheetId.toString().c_str() );
}
// Night to day hour
if( ! SeasonElt->getValueByName( LightCycles[ i ].NightToDayHour, "NightToDayHour" ) )
{
nlwarning("<CStaticLightCycle readGeorges> can get value NightToDayHour in node %d on SeasonElt structure in sheet %s", i, sheetId.toString().c_str() );
}
}
}
}
}// CStaticLightCycle readGeorges
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:60,代码来源:static_light_cycle.cpp
示例13: systemCraftItem
//-----------------------------------------------
// CFaberPhrase systemCraftItem:
//-----------------------------------------------
CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const std::vector< NLMISC::CSheetId >& Mp, const std::vector< NLMISC::CSheetId >& MpFormula )
{
H_AUTO(CFaberPhrase_systemCraftItem);
std::vector< const CStaticBrick* > bricks;
_RootFaberPlan = CSheets::getSBrickForm( sheet );
const CStaticBrick * rootFaberBricks = CSheets::getSBrickForm( CSheetId("bcpa01.sbrick") );
if( rootFaberBricks )
{
_RootFaberBricks = true;
}
else
{
nlwarning("<CFaberPhrase::systemCraftItem> Can't found form of root faber brick bcpa01.sbrick");
return 0;
}
CGameItemPtr craftedItem = 0;
if( _RootFaberPlan && _RootFaberPlan->Faber )
{
_CraftedItemStaticForm = CSheets::getForm( _RootFaberPlan->Faber->CraftedItem );
if( _CraftedItemStaticForm == 0 )
{
return 0;
}
bricks.push_back( rootFaberBricks );
bricks.push_back( _RootFaberPlan );
for( vector< NLMISC::CSheetId >::const_iterator it = Mp.begin(); it != Mp.end(); ++it )
{
const CStaticItem * mp = CSheets::getForm( (*it) );
if( mp == 0 )
{
nlwarning("<CFaberPhrase::systemCraftItem> Can't found form for Mp %s for craft %s item", (*it).toString().c_str(), sheet.toString().c_str() );
return 0;
}
_Mps.push_back( mp );
}
// Check quantity of gived Mps
if( _RootFaberPlan->Faber->NeededMps.size() > _Mps.size() )
{
nlwarning("<CFaberPhrase::systemCraftItem> Not enought gived RM for crafting %s (gived Mp %d, Needed Mp %d)", sheet.toString().c_str(), _Mps.size(), _RootFaberPlan->Faber->NeededMps.size() );
return 0;
}
for( vector< NLMISC::CSheetId >::const_iterator it = MpFormula.begin(); it != MpFormula.end(); ++it )
{
const CStaticItem * mp = CSheets::getForm( (*it) );
if( mp == 0 )
{
nlwarning("<CFaberPhrase::systemCraftItem> Can't found form for Mp Formula %s for craft %s item", (*it).toString().c_str(), sheet.toString().c_str() );
return 0;
}
_MpsFormula.push_back( mp );
}
// Check quantity of gived Mps formula
if( _RootFaberPlan->Faber->NeededMpsFormula.size() > _MpsFormula.size() )
{
nlwarning("<CFaberPhrase::systemCraftItem> Not enought gived RM formula for crafting %s (gived Mp %d, Needed Mp %d)", sheet.toString().c_str(), _MpsFormula.size(), _RootFaberPlan->Faber->NeededMpsFormula.size() );
return 0;
}
// build the craft action
_FaberAction = IFaberActionFactory::buildAction( _ActorRowId, this, _CraftedItemStaticForm->Type );
if ( !_FaberAction )
{
nlwarning( "<CFaberPhrase build> could not build action for root faber %s", _RootFaberPlan->SheetId.toString().c_str() );
return 0;
}
_FaberAction->systemApply(this);
if( _CraftedItem != 0 )
{
_CraftedItem->setDefaultColor();
}
craftedItem = _CraftedItem;
_CraftedItem = 0;
}
return craftedItem;
} // systemCraftItem //
开发者ID:Kiddinglife,项目名称:ryzom,代码行数:86,代码来源:faber_phrase.cpp
示例14: createInGameItem
//-----------------------------------------------
// createInGameItem
//-----------------------------------------------
CGameItemPtr CGameItemManager::createInGameItem( uint16 quality, uint32 quantity, const NLMISC::CSheetId &sheet, const CEntityId &creatorId , const std::string * phraseId)
{
H_AUTO(GIM_createInGameItem);
static const CSheetId preorderSheetId("pre_order.sitem");
if ( quantity == 0 || quality ==0 )
return NULL;
// static const CSheetId idSheetStack("stack.sitem");
const CStaticItem* form = CSheets::getForm( sheet );
if (!form)
{
nlwarning("<CCharacter::createInGameItem> Cannot find form of item %s", sheet.toString().c_str());
return NULL;
}
CGameItemPtr item;
CGameItemPtr sellingItem;
// if item can be sold, get it in the sold items list
if ( form->Family != ITEMFAMILY::RAW_MATERIAL
&& form->Family != ITEMFAMILY::HARVEST_TOOL
&& form->Family != ITEMFAMILY::CRAFTING_TOOL
&& form->Family != ITEMFAMILY::CRYSTALLIZED_SPELL
&& form->Family != ITEMFAMILY::ITEM_SAP_RECHARGE
&& form->Family != ITEMFAMILY::FOOD
)
{
vector< CGameItemPtr >::const_iterator it;
const vector< CGameItemPtr >::const_iterator itEnd = CStaticItems::getStaticItems().end();
for( it = CStaticItems::getStaticItems().begin(); it != itEnd; ++it )
{
if( (*it)->getSheetId() == sheet )
{
sellingItem = *it;
break;
}
}
}
switch( form->Family )
{
case ITEMFAMILY::CRAFTING_TOOL:
case ITEMFAMILY::HARVEST_TOOL:
case ITEMFAMILY::RAW_MATERIAL:
case ITEMFAMILY::TELEPORT:
case ITEMFAMILY::CRYSTALLIZED_SPELL:
case ITEMFAMILY::ITEM_SAP_RECHARGE:
case ITEMFAMILY::MISSION_ITEM:
case ITEMFAMILY::PET_ANIMAL_TICKET:
case ITEMFAMILY::HANDLED_ITEM:
case ITEMFAMILY::CONSUMABLE:
case ITEMFAMILY::XP_CATALYSER:
case ITEMFAMILY::SCROLL:
case ITEMFAMILY::FOOD:
case ITEMFAMILY::SCROLL_R2:
case ITEMFAMILY::GENERIC_ITEM:
{
item = GameItemManager.createItem( const_cast< CSheetId& > ( sheet ), quality, true, true, creatorId);
}
break;
default:
{
if( sellingItem != NULL )
{
item = sellingItem->getItemCopy();
item->quality( quality );
if ( phraseId )
item->setPhraseId(*phraseId);
}
else if (sheet == preorderSheetId)
{
item = GameItemManager.createItem(sheet, quality, true, form->DropOrSell, creatorId);
}
}
if( item == NULL)
{
nlwarning("<CCharacter::createInGameItem> Error while creating item : NULL pointer");
return NULL;
}
}
quantity = min(quantity, item->getMaxStackSize());
item->setStackSize(quantity);
return item;
} // createInGameItem //
开发者ID:mixxit,项目名称:solinia,代码行数:88,代码来源:game_item_manager.cpp
示例15: loadFromGeorges
//--------------------------------------------------------------
// loadFromGeorges()
//--------------------------------------------------------------
void CStaticHarvestable::loadFromGeorges( const UForm &form, const NLMISC::CSheetId &sheetId )
{
_Mps.clear();
/*
// getVarListFromParents (&form, arrayList, "Harvest");
std::set<NLGEORGES::UFormElm*> arrayList;
{
NLGEORGES::UFormElm *tmpelem=NULL;
const_cast<NLGEORGES::UFormElm*>(&form.getRootNode())->getNodeByName(&tmpelem, "Harvest");
if (tmpelem)
{
arrayList.insert(tmpelem);
}
}
if (arrayList.empty())
{
return;
}
for (std::set<NLGEORGES::UFormElm*>::iterator it=arrayList.begin(), itEnd=arrayList.end(); it!=itEnd;++it)
{
NLGEORGES::UFormElm *elem=*it;
*/
{
string value;
if ( form.getRootNode().getValueByName( value, (string("Harvest.")+"Skill").c_str() )
&& !value.empty() )
{
_HarvestSkill = SKILLS::toSkill( value );
}
}
// in Georges sheet MP starts with MP1 and ends with MP10
if (VerboseQuartering)
nldebug("QRTR: Loading RMs of creatures %s", sheetId.toString().c_str());
for (uint i = 1 ; i <= NbRawMaterials ; ++i)
{
const string mpName=NLMISC::toString("MP%u",i);
CStaticCreatureRawMaterial mp;
if( form.getRootNode().getValueByName( mp.MpCommon.AssociatedItemName, ("Harvest." +mpName+".AssociatedItem").c_str())
&& !mp.MpCommon.AssociatedItemName.empty() )
{
if (VerboseQuartering)
nldebug("QRTR: %s=%s", mpName.c_str(), mp.MpCommon.AssociatedItemName.c_str());
form.getRootNode().getValueByName( mp.MpCommon.Name, ("Harvest." +mpName+".Name").c_str() );
uint16 sheetQuantity;
form.getRootNode().getValueByName( sheetQuantity, ("Harvest." +mpName+".Quantity").c_str() );
if ( sheetQuantity != 0 )
{
nlwarning( "Quantity set to %hu in %s", sheetQuantity, sheetId.toString().c_str() );
}
form.getRootNode().getValueByName( mp.MpCommon.MinQuality, ("Harvest." +mpName+".MinQuality").c_str() );
form.getRootNode().getValueByName( mp.MpCommon.MaxQuality, ("Harvest." +mpName+".MaxQuality").c_str() );
// harvest->getValueByName( mp.PresenceProbabilities, (mpName+".PresenceProbabilities").c_str() );
mp.ItemId = mp.MpCommon.AssociatedItemName;
if ( mp.MpCommon.MinQuality == 0)
mp.MpCommon.MinQuality = 1;
if ( mp.MpCommon.MaxQuality == 0)
mp.MpCommon.MaxQuality = 5;
/// end temp hack
const CStaticItem *staticItem = CSheets::getForm( mp.ItemId );
if ( staticItem )
{
string itemSheetCode = mp.ItemId.toString();
// Identify the usage of the RM (if it is a raw material for mission or craft) or fixed quantity (for invasion reward)
if ( ( itemSheetCode.find( "ixx" ) != string::npos) ||
( itemSheetCode.find( "cxx" ) != string::npos ) )
{
if (VerboseQuartering)
nldebug("QRTR: For invasions");
if( itemSheetCode == "m0077ixxcc01.sitem" )
{
mp.UsageAndQuantity.Usage = (uint16)RMUTotalQuantity;
mp.UsageAndQuantity.QuantityVar = (TRMQuantityVariable)(RMQVForceBase+5);
}
else
{
// Invasion/goo raw material: fixed quantity, depending on creature local level
//nldebug( "%s/%s: fixed quantity", sheetId.toString().c_str(), itemSheetCode.c_str() );
mp.UsageAndQuantity.Usage = (uint16)RMUFixedQuantity;
string creatureCode = sheetId.toString();
uint16 creatureLocalLevel;
form.getRootNode().getValueByName( creatureLocalLevel, "Basics.LocalCode" );
if ( itemSheetCode.size() >= 12 )
{
uint itemVariant = (uint)(itemSheetCode[11] - '0');
switch ( itemVariant )
{
//.........这里部分代码省略.........
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:101,代码来源:egs_static_harvestable.cpp
示例16: readGeorges
// ***************************************************************************
void CSheetManagerEntry::readGeorges (const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const NLMISC::CSheetId &sheetId)
{
// Load the form with given sheet id
if (form)
{
// if (EntitySheet != NULL)
// delete EntitySheet;
CEntitySheet *sheet = NULL;
std::string extension = NLMISC::CSheetId::fileExtensionFromType(sheetId.getSheetType());
// create the new structure
if (extension == "creature")
sheet = new CCharacterSheet;
else if(extension == "player")
sheet = new CPlayerSheet;
else if(extension == "fx")
sheet = new CFXSheet;
else if(extension == "building")
sheet = new CBuildingSheet;
else if(extension == "sitem" || extension == "item" )
sheet = new CItemSheet;
else if(extension == "plant")
sheet = new CPlantSheet;
else if(extension == "death_impact")
sheet = new CPactSheet;
else if(extension == "mission")
sheet = new CMissionSheet;
else if(extension == "race_stats")
sheet = new CRaceStatsSheet;
else if(extension == "light_cycle")
sheet = new CLightCycleSheet;
else if(extension == "weather_setup")
sheet = new CWeatherSetupSheet;
else if(extension == "continent")
sheet = new CContinentSheet;
else if(extension == "world")
sheet = new CWorldSheet;
else if(extension == "weather_function_params")
sheet = new CWeatherFunctionParamsSheet;
else if(extension == "mission_icon")
sheet = new CMissionIconSheet;
else if(extension == "sbrick")
sheet = new CSBrickSheet;
else if(extension == "sphrase")
sheet = new CSPhraseSheet;
else if(extension == "skill_tree")
sheet = new CSkillsTreeSheet;
else if(extension == "titles")
sheet = new CUnblockTitlesSheet;
else if(extension == "succes_chances_table")
sheet = new CSuccessTableSheet;
else if(extension == "automaton_list")
sheet = new CAutomatonListSheet;
else if(extension == "animset_list")
sheet = new CAnimationSetListSheet;
else if(extension == "animation_fx")
sheet = new CAnimationFXSheet;
else if(extension == "id_to_string_array")
sheet = new CIDToStringArraySheet;
else if(extension == "emot")
sheet = new CEmotListSheet;
else if(extension == "forage_source")
sheet = new CForageSourceSheet;
else if(extension == "flora")
sheet = new CFloraSheet;
else if(extension == "animation_fx_set")
sheet = new CAnimationFXSetSheet;
else if(extension == "attack_list")
sheet = new CAttackListSheet;
else if(extension == "text_emotes")
sheet = new CTextEmotListSheet;
else if(extension == "sky")
sheet = new CSkySheet;
else if(extension == "outpost")
sheet = new COutpostSheet;
else if(extension == "outpost_building")
sheet = new COutpostBuildingSheet;
else if(extension == "outpost_squad")
sheet = new COutpostSquadSheet;
else if(extension == "faction")
sheet = new CFactionSheet;
else
{
nlwarning("CSheetManager::loadSheet: Do not know how to create the class from the sheet '%s'.", sheetId.toString().c_str());
return;
}
// Build the sheet from an external file.
sheet->Id = sheetId;
sheet->build(form->getRootNode());
EntitySheet = sheet;
SheetMngr.processSheet(EntitySheet);
}
// Error while loading the form.
else
{
//.........这里部分代码省略.........
开发者ID:mixxit,项目名称:solinia,代码行数:101,代码来源:sheet_manager.cpp
示例17: build
//=======================================================
void CSeasonFXSheet::build(const NLGEORGES::UFormElm &item, NLMISC::CSheetId parentId, const std::string &prefix)
{
bool ok = true;
ok &= item.getValueByName(FXName, (prefix + "FXName").c_str());
if (FXName.empty()) return;
uint32 fxMode = 0;
ok &= item.getValueByName(fxMode, (prefix + "Mode").c_str());
Mode = (TMode) fxMode;
ok &= item.getValueByName(CycleDuration, (prefix + "CycleDuration").c_str());
ok &= item.getValueByName(StartHourMin, (prefix + "StartHourMin").c_str());
ok &= item.getValueByName(StartHourMax, (prefix + "StartHourMax").c_str());
ok &= item.getValueByName(EndHourMin, (prefix + "EndHourMin").c_str());
ok &= item.getValueByName(EndHourMax, (prefix + "EndHourMax").c_str());
ok &= item.getValueByName(InheritScale, (prefix + "InheritScale").c_str());
ok &= item.getValueByName(InheritRot, (prefix + "InheritRot").c_str());
ok &= item.getValueByName(AngleMin, (prefix + "AngleMin").c_str());
ok &= item.getValueByName(AngleMax, (prefix + "AngleMax").c_str());
ok &= item.getValueByName(DontRotate, (prefix + "DontRotate").c_str());
ok &= item.getValueByName(DontRotateAroundLocalZ, (prefix + "DontRotateAroundLocalZ").c_str());
ok &= item.getValueByName(ScaleMin.x, (prefix + "ScaleMinX").c_str());
ok &= item.getValueByName(ScaleMin.y, (prefix + "ScaleMinY").c_str());
ok &= item.getValueByName(ScaleMin.z, (prefix + "ScaleMinZ").c_str());
ok &= item.getValueByName(ScaleMax.x, (prefix + "ScaleMaxX").c_str());
ok &= item.getValueByName(ScaleMax.y, (prefix + "ScaleMaxY").c_str());
ok &= item.getValueByName(ScaleMax.z, (prefix + "ScaleMaxZ").c_str());
ok &= item.getValueByName(UniformScale, (prefix + "UniformScale").c_str());
ok &= item.getValueByName(WantScaling, (prefix + "WantScaling").c_str());
ok &= item.getValueByName(AlignOnWater, (prefix + "AlignOnWater").c_str());
ok &= item.getValueByName(ZOffset, (prefix + "ZOffset").c_str());
// Anti Crash
if(CycleDuration<=0)
{
nlwarning("FX: CPlantSheet '%s' has a season with a CycleDuration<=0: %f !!!!! setting it to 0.1.",
parentId.toString().c_str(), CycleDuration);
CycleDuration= 0.1f;
}
StartHourMin = fmodf(StartHourMin, CycleDuration);
StartHourMax = fmodf(StartHourMax, CycleDuration);
EndHourMin = fmodf(EndHourMin, CycleDuration);
EndHourMax = fmodf(EndHourMax, CycleDuration);
nlassert(isValidDouble(StartHourMin));
nlassert(isValidDouble(StartHourMax));
nlassert(isValidDouble(EndHourMin));
nlassert(isValidDouble(EndHourMax));
nlassert(isValidDouble(CycleDuration));
for(uint k = 0; k < 4; ++k)
{
ok &= item.getValueByName(UserParamsMin[k], (prefix + NLMISC::toString("UserParam%dMin", (int) k)).c_str());
ok &= item.getValueByName(UserParamsMax[k], (prefix + NLMISC::toString("UserParam%dMax", (int) k)).c_str());
}
ok &= item.getValueByName(MinDuration, (prefix + "MinDuration").c_str());
ok &= item.getValueByName(MaxDuration, (prefix + "MaxDuration").c_str());
// prevent from overlapping interval
if (Mode != AlwaysStarted && Mode != UseDuration && Mode != Spawn)
{
float startHourMin = StartHourMin;
float startHourMax = StartHourMax;
if (startHourMax < startHourMin)
{
startHourMax += CycleDuration;
}
float endHourMin = EndHourMin;
float endHourMax = EndHourMax;
if (endHourMax < endHourMin)
{
endHourMax += CycleDuration;
}
if (!(startHourMax <= endHourMin || startHourMin >= endHourMax))
{
// intervals overlap -> bad
nlwarning("Overlapping time intervals for fx spawn.");
if (startHourMin <= endHourMin)
{
float inter = endHourMin;
if (inter >= CycleDuration)
{
inter -= CycleDuration;
}
StartHourMax = inter;
}
else
{
float inter = startHourMin;
if (inter >= CycleDuration)
{
inter -= CycleDuration;
}
EndHourMax = inter;
}
}
}
// compute duration of start interval
float startHourMaxInterval;
if (StartHourMin <= StartHourMax)
{
//.........这里部分代码省略.........
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:101,代码来源:plant_sheet.cpp
示例18: readGeorges
//-----------------------------------------------
// readGeorges for CStaticSkillsTree
//
//-----------------------------------------------
void CStaticSkillsTree::readGeorges( const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const NLMISC::CSheetId &sheetId )
{
if( form )
{
UFormElm& root = form->getRootNode();
UFormElm *arraySkillElt = NULL;
if( root.getNodeByName( &arraySkillElt, "SkillData" ) )
{
if( arraySkillElt )
{
uint NbSkills;
nlverify( arraySkillElt->getArraySize( NbSkills ) );
nlassertex( NbSkills == SKILLS::NUM_SKILLS, ("(%u != %u) Please synchronise game_share/skill.* with leveldesign/game_element/xp_table/skills.skill_tree (use skill_extractor.exe)", NbSkills, SKILLS::NUM_SKILLS));
SkillsTree.resize( NbSkills );
for( uint i = 0; i < NbSkills; ++i )
{
UFormElm* SkillElt = NULL;
if( ! ( arraySkillElt->getArrayNode( &SkillElt, i ) && SkillElt ) )
{
nlwarning("<CStaticSkillsTree::readGeorges> can't get array node of SkillElt in sheet %s", sheetId.toString().c_str() );
}
else
{
// Skill
string SkillName;
SkillElt->getValueByName( SkillName, "Skill" );
SKILLS::ESkills skill = SKILLS::toSkill( SkillName );
nlassert( skill != SKILLS::unknown );
if (skill == SKILLS::unknown)
{
continue;
}
SkillsTree[ skill ].Skill = skill;
if( ! SkillElt->getValueByName( SkillsTree[ skill ].SkillCode, "SkillCode" ) )
{
nlwarning("<CStaticSkillsTree::readGeorges> can't get node SkillCode in sheet %s", sheetId.toString().c_str() );
}
// Skill Code
if( ! SkillElt->getValueByName( SkillsTree[ skill ].SkillCode, "SkillCode" ) )
{
nlwarning("<CStaticSkillsTree::readGeorges> can't get node SkillCode in sheet %s", sheetId.toString().c_str() );
}
// Max skill value
if( ! SkillElt->getValueByName( SkillsTree[ skill ].MaxSkillValue, "MaxSkillValue" ) )
{
nlwarning("<CStaticSkillsTree::readGeorges> can't get node MaxSkillValue in sheet %s", sheetId.toString().c_str() );
}
// Type of stage
if( ! SkillElt->getValueByName( SkillsTree[ skill ].StageType, "Type of Stage" ) )
{
nlwarning("<CStaticSkillsTree::readGeorges> can't get node 'Type of Stage' in sheet %s", sheetId.toString().c_str() );
}
// ParentSkill
if( ! SkillElt->getValueByName( SkillName, "ParentSkill" ) )
{
nlwarning("<CStaticSkillsTree::readGeorges> can't get node ParentSkills in sheet %s", sheetId.toString().c_str() );
}
else
{
SkillsTree[ skill ].ParentSkill = SKILLS::toSkill( SkillName );
}
// ChildSkills
UFormElm *arrayChildSkillElt = NULL;
if( SkillElt->getNodeByName( &arrayChildSkillElt, "ChildSkills" ) )
{
if( arrayChildSkillElt )
{
uint NbChildSkills;
nlverify( arrayChildSkillElt->getArraySize( NbChildSkills ) );
SkillsTree[ skill ].ChildSkills.resize( NbChildSkills );
for( uint i = 0; i < NbChildSkills; ++i )
{
string childSkillName;
arrayChildSkillElt->getArrayValue( childSkillName, i );
SKILLS::ESkills childSkill = SKILLS::toSkill( childSkillName );
nlassert( childSkill != SKILLS::unknown );
if (skill == SKILLS::unknown)
{
continue;
}
SkillsTree[ skill ].ChildSkills[ i ] = childSkill;
}
}
}
//.........这里部分代码省略.........
开发者ID:Kiddinglife,项目名称:ryzom,代码行数:101,代码来源:skill_tree.cpp
注:本文中的nlmisc::CSheetId类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论