本文整理汇总了C++中ItemType::isSplash方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemType::isSplash方法的具体用法?C++ ItemType::isSplash怎么用?C++ ItemType::isSplash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemType
的用法示例。
在下文中一共展示了ItemType::isSplash方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateItem
Item* Item::CreateItem(PropStream& propStream)
{
unsigned short _id;
if(!propStream.GET_USHORT(_id)){
return NULL;
}
ItemType iType = Item::items[_id];
unsigned char _count = 1;
if(iType.stackable || iType.isSplash() || iType.isFluidContainer()){
if(!propStream.GET_UCHAR(_count)){
return NULL;
}
}
return Item::CreateItem(_id, _count);
}
示例2: getDescription
//.........这里部分代码省略.........
} else if (it.isContainer()) {
s << " (Vol:" << (int32_t)it.maxItems << ")";
} else {
bool found = true;
if (it.abilities) {
if (it.abilities->speed > 0) {
s << " (speed " << std::showpos << (it.abilities->speed / 2) << std::noshowpos << ")";
} else if (it.abilities && hasBitSet(CONDITION_DRUNK, it.abilities->conditionSuppressions)) {
s << " (hard drinking)";
} else if (it.abilities->invisible) {
s << " (invisibility)";
} else if (it.abilities->regeneration) {
s << " (faster regeneration)";
} else if (it.abilities->manaShield) {
s << " (mana shield)";
} else {
found = false;
}
} else {
found = false;
}
if (!found) {
if (it.isKey()) {
s << " (Key:" << (item ? (int32_t)item->getActionId() : 0) << ")";
} else if (it.isFluidContainer()) {
if (subType > 0) {
const std::string& itemName = items[subType].name;
s << " of " << (itemName.length() ? itemName : "unknown");
} else {
s << ". It is empty";
}
} else if (it.isSplash()) {
s << " of ";
if (subType > 0 && items[subType].name.length()) {
s << items[subType].name;
} else {
s << "unknown";
}
} else if (it.allowDistRead && it.id != 7369 && it.id != 7370 && it.id != 7371) {
s << "." << std::endl;
if (lookDistance <= 4) {
if (item && !item->getText().empty()) {
if (item->getWriter().length()) {
s << item->getWriter() << " wrote";
time_t date = item->getDate();
if (date > 0) {
s << " on " << formatDateShort(date);
}
s << ": ";
} else {
s << "You read: ";
}
std::string outtext;
if (utf8ToLatin1(item->getText().c_str(), outtext)) {
s << outtext;
} else {
s << item->getText();
}
示例3: getDescription
//.........这里部分代码省略.........
s << ", ";
s << "mana shield";
}
if(hasBitSet(CONDITION_DRUNK, it.abilities->conditionSuppressions))
{
if(begin)
{
begin = false;
s << " (";
}
else
s << ", ";
s << "hard drinking";
}
if(!begin)
s << ")";
}
}
else if(it.isContainer())
s << " (Vol:" << (int32_t)it.maxItems << ")";
else if(it.isKey())
s << " (Key:" << (item ? (int32_t)item->getActionId() : 0) << ")";
else if(it.isFluidContainer())
{
if(subType > 0)
s << " of " << (items[subType].name.length() ? items[subType].name : "unknown");
else
s << ". It is empty";
}
else if(it.isSplash())
{
s << " of ";
if(subType > 0 && items[subType].name.length())
s << items[subType].name;
else
s << "unknown";
}
else if(it.allowDistRead)
{
s << "." << std::endl;
if(item && !item->getText().empty())
{
if(lookDistance <= 4)
{
if(!item->getWriter().empty())
{
s << item->getWriter() << " wrote";
time_t date = item->getDate();
if(date > 0)
s << " on " << formatDate(date);
s << ": ";
}
else
s << "You read: ";
std::string text = item->getText();
s << text;
char end = *text.rbegin();
if(end == '?' || end == '!' || end == '.')
dot = false;
示例4: getDescription
//.........这里部分代码省略.........
else
s << "mixed";
s << " damage";
}
if(it.abilities.speed)
{
if(begin)
{
begin = false;
s << " (";
}
else
s << ", ";
s << "speed " << std::showpos << (int32_t)(it.abilities.speed / 2) << std::noshowpos;
}
if(!begin)
s << ")";
}
else if(it.isContainer())
s << " (Vol:" << (int32_t)it.maxItems << ")";
else if(it.isKey())
s << " (Key:" << (item ? (int32_t)item->getActionId() : 0) << ")";
else if(it.isFluidContainer())
{
if(subType > 0)
s << " of " << (items[subType].name.length() ? items[subType].name : "unknown");
else
s << ". It is empty";
}
else if(it.isSplash())
{
s << " of ";
if(subType > 0 && items[subType].name.length())
s << items[subType].name;
else
s << "unknown";
}
else if(it.allowDistRead)
{
s << std::endl;
if(item && !item->getText().empty())
{
if(lookDistance <= 4)
{
if(!item->getWriter().empty())
{
s << item->getWriter() << " wrote";
time_t date = item->getDate();
if(date > 0)
s << " on " << formatDate(date);
s << ": ";
}
else
s << "You read: ";
std::string text = item->getText();
s << text;
if(!text.empty())
{
char end = *text.rbegin();
if(end == '?' || end == '!' || end == '.')
示例5: getDescription
//.........这里部分代码省略.........
{
s << ", ";
}
s << "defense " << std::showpos << (int32_t)it.defense << std::noshowpos;
prevDesc = true;
}
if (it.abilities.speed != 0)
{
if (prevDesc)
{
s << ", ";
}
s << "speed " << std::showpos << (int32_t)(it.abilities.speed / 2) << std::noshowpos;
// last desc... same thing as the first
//prevDesc = true;
}
s << ").";
}
else if (it.isFluidContainer())
{
if (subType > 0)
{
s << " of " << items[subType].name << ".";
}
else
{
s << ". It is empty.";
}
}
else if (it.isSplash())
{
s << " of ";
if (subType > 0)
{
s << items[subType].name << ".";
}
else
{
s << items[1].name << ".";
}
}
else if (it.isContainer())
{
s << " (Vol:" << (int32_t)it.maxItems << ").";
}
else if (it.isKey())
{
if (item)
{
s << " (Key:" << (int32_t)item->getActionId() << ").";
}
else
{
s << " (Key:0).";
}
}
else if (it.allowDistRead)
{
s << std::endl;
if (item && item->getText() != "")
示例6: getDescription
//.........这里部分代码省略.........
s << ", ";
s << "magic level " << std::showpos << (int)it.abilities.stats[STAT_MAGICPOINTS] << std::noshowpos;
}
s << ")";
}
}
s << ".";
}
else if (it.armor != 0 || it.abilities.absorb.any()){
if (it.showCharges){
if (subType > 1){
s << " that has " << (int32_t)subType << " charges left";
}
else{
s << " that has 1 charge left";
}
}
if (it.armor != 0){
s << " (Arm:" << it.armor << ")";
}
s << ".";
}
else if (it.isFluidContainer()){
if (item && item->getFluidType() != 0){
s << " of " << items[item->getFluidType()].name << ".";
}
else{
s << ". It is empty.";
}
}
else if (it.isSplash()){
s << " of ";
if (item && item->getFluidType() != 0){
s << items[item->getFluidType()].name << ".";
}
else{
s << items[1].name;
}
}
else if (it.isContainer()){
s << " (Vol:" << (int)it.maxItems << ").";
}
else if (it.isKey()){
if (item){
s << " (Key:" << (int)item->getActionId() << ").";
}
else{
s << " (Key:" << (int)0 << ").";
}
}
else if (it.allowDistRead){
s << "." << std::endl;
if (item && item->getText() != ""){
if (lookDistance <= 4){
if (item->getWriter().length()){
s << item->getWriter() << " wrote: ";
}
else{
s << "You read: ";
}
s << item->getText();
示例7: getDescription
//.........这里部分代码省略.........
}
if(it.abilities.absorbPercentLifeDrain != 0){
if(!isBegin){
s << ",";
}
s << " life drain " << std::showpos << it.abilities.absorbPercentLifeDrain << std::noshowpos << "%";
isBegin = false;
}
if(it.abilities.absorbPercentManaDrain != 0){
if(!isBegin){
s << ",";
}
s << " mana drain " << std::showpos << it.abilities.absorbPercentManaDrain << std::noshowpos << "%";
isBegin = false;
}
if(it.abilities.absorbPercentPhysical != 0){
if(!isBegin){
s << ",";
}
s << " physical " << std::showpos << it.abilities.absorbPercentPhysical << std::noshowpos << "%";
isBegin = false;
}
}
s << ").";
}
else if(it.isFluidContainer()){
if(subType > 0){
s << " of " << items[subType].name << ".";
}
else{
s << ". It is empty.";
}
}
else if(it.isSplash()){
s << " of ";
if(subType > 0){
s << items[subType].name;
}
else{
s << items[1].name;
}
}
else if(it.isContainer()){
s << " (Vol:" << (int)it.maxItems << ").";
}
else if(it.isKey()){
if(item){
s << " (Key:" << (int)item->getActionId() << ").";
}
else{
s << " (Key:0).";
}
}
else if(it.allowDistRead){
s << std::endl;
if(item && item->getText() != ""){
if(lookDistance <= 4){
if(item->getWriter().length()){
s << item->getWriter() << " wrote";
time_t wDate = item->getWrittenDate();
if(wDate > 0){
char date[16];
formatDate2(wDate, date);
s << " on " << date;