本文整理汇总了C++中P_CHAR::chgDex方法的典型用法代码示例。如果您正苦于以下问题:C++ P_CHAR::chgDex方法的具体用法?C++ P_CHAR::chgDex怎么用?C++ P_CHAR::chgDex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_CHAR
的用法示例。
在下文中一共展示了P_CHAR::chgDex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Off
void cTmpEff::Off(P_CHAR pc)
{
if (!pc)
return;
switch(this->num)
{
case 1: pc->priv2 &= 0xFD; break;
case 2: pc->fixedlight='\xFF'; break;
case 3: pc->chgDex(this->more1); break;
case 4: pc->in+=this->more1; break;
case 5: pc->st+=this->more1; break;
case 6: pc->chgDex(-1 * this->more1);break;
case 7: pc->in-=this->more1; break;
case 8: pc->st-=this->more1; break;
case 11:
pc->st-=this->more1;
pc->chgDex(-1 * this->more2);
pc->in-=this->more3;
break;
case 12:
pc->st+=this->more1;
pc->chgDex(this->more2);
pc->in+=this->more3;
break;
}
}
示例2: On
void cTmpEff::On(P_CHAR pc)
{
if (!pc)
return;
switch(this->num)
{
case 1: pc->priv2 |= 0x02; break;
case 2: pc->fixedlight = SrvParams->worldBrightLevel();break;
case 3: pc->chgDex(-1 * this->more1); break;
case 4: pc->in-=this->more1; break;
case 5: pc->st-=this->more1; break;
case 6: pc->chgDex(this->more1); break;
case 7: pc->in+=this->more1; break;
case 8: pc->st+=this->more1; break;
case 11:
pc->st+=this->more1;
pc->chgDex(this->more2);
pc->in+=this->more3;
break;
case 12:
pc->st-=this->more1;
pc->chgDex(-1 * this->more2);
pc->in-=this->more3;
break;
}
}
示例3: FindCharBySerial
// Name: item_bounce3
// Purpose: holds some statements that were COPIED some 50 times
// Remarks: temporary functions to revamp the 30 occurences of the 'bouncing bugfix'
// History: init Duke, 10.8.2000
static void item_bounce3(const P_ITEM pi)
{
pi->SetContSerial(pi->oldcontserial);
pi->pos.x=pi->oldx;
pi->pos.y=pi->oldy;
pi->pos.z=pi->oldz;
pi->layer=pi->oldlayer;
pi->flags.isBeeingDragged=false;
P_CHAR pc = FindCharBySerial(pi->oldcontserial);
if (pi->layer > 0 && pc != NULL)
{
pc->st += pi->st2;
pc->chgDex(pi->dx2);
pc->in += pi->in;
}
}
示例4: equipItem
// Tries to equip an item
// if that fails it tries to put the item in the users backpack
// if *that* fails it puts it at the characters feet
// That works for NPCs as well
void equipItem( P_CHAR wearer, P_ITEM item )
{
tile_st tile;
Map->SeekTile( item->id(), &tile );
// User cannot wear the item
if( tile.layer == 0 )
{
if( online( wearer ) )
sysmessage( calcSocketFromChar( wearer ), "You cannot wear that item." );
item->toBackpack( wearer );
return;
}
vector< SERIAL > equipment = contsp.getData( wearer->serial );
// If n item on the same layer is already equipped, unequip it
for( UI08 i = 0; i < equipment.size(); i++ )
{
P_ITEM equip = FindItemBySerial( equipment[ i ] );
// Unequip the item and free the layer that way
if( equip && ( equip->layer() == tile.layer ) )
equip->toBackpack( wearer );
wearer->removeItemBonus( equip );
}
// *finally* equip the item
item->setContSerial( wearer->serial );
// Add the item bonuses
wearer->st = (wearer->st + item->st2);
wearer->chgDex( item->dx2 );
wearer->in = (wearer->in + item->in2);
}
示例5: Add
bool cAllTmpEff::Add(P_CHAR pc_source, P_CHAR pc_dest, int num, unsigned char more1, unsigned char more2, unsigned char more3, short dur)
{
unsigned int ic; // antichrist' changes
int color, color1, color2, socket; //used for incognito spell
int loopexit=0;
if ( pc_source == NULL || pc_dest == NULL )
return false;
if (teffectcount>=cmem*5)
return false;
cTmpEff *pTE;
for (ic=0; ic<teffectcount; ic++) // If there is already an effect of the same or similar kind, reverse it first (Duke)
{
pTE = &teffects[ic];
if (pTE->getDest() == pc_dest->serial)
{
if ((pTE->num==3 && num==3)||
(pTE->num==4 && num==4)||
(pTE->num==5 && num==5)||
(pTE->num==6 && num==6)||
(pTE->num==7 && num==7)||
(pTE->num==8 && num==8)||
(pTE->num==11&& num==11)||
(pTE->num==12&& num==12)||
(pTE->num==18&& num==18)|| //added Poly reverse - AntiChrist (9/99)
(pTE->num==21&& num==21)||
(pTE->num==19&& num==19)|| //added Incognito reverse - AntiChrist (12/99)
(pTE->num==18&& num==19)|| //reverse poly effect if we have to use incognito - AntiChrist (12/99)
(pTE->num==19&& num==18) ) //reverse incognito effect if we have to use poly - AntiChrist (12/99)
{
pTE->Reverse();
AllTmpEff->Remove(pTE);
}
}
}
pTE=new cTmpEff;
pTE->Init();
pTE->setSour(pc_source->serial);
pTE->setDest(pc_dest->serial);
pTE->num=num;
switch (num)
{
case 1:
pc_dest->priv2 |= 0x02;
pTE->setExpiretime_s(pc_source->skill[MAGERY]/100);
pTE->more1=0;
pTE->more2=0;
pTE->dispellable=1;
break;
case 2: // night sight
pc_dest->fixedlight=worldbrightlevel;
dolight(calcSocketFromChar((pc_dest)), worldbrightlevel);
Magic->afterParticles(6, pc_dest); // shows particles for UO:3D clients, like On OSI servers
if(dur > 0) // if a duration is given (potions), use that (Duke, 30.12.2000)
pTE->setExpiretime_s(dur);
else
pTE->setExpiretime_s(pc_source->skill[MAGERY]*10);
pTE->more1=0;
pTE->more2=0;
pTE->dispellable=1;
break;
case 3:
if (pc_dest->effDex()<more1)
more1=pc_dest->effDex();
pc_dest->chgDex(-1 * more1);
pc_dest->stm=min(pc_dest->stm, (int)pc_dest->effDex());
statwindow(calcSocketFromChar(pc_dest), pc_dest);
pTE->setExpiretime_s(pc_source->skill[MAGERY]/10);
pTE->more1=more1;
pTE->more2=0;
pTE->dispellable=1;
break;
case 4:
if (pc_dest->in<more1)
more1=pc_dest->in;
pc_dest->in-=more1;
pc_dest->mn=min(pc_dest->mn, pc_dest->in);
statwindow(calcSocketFromChar(pc_dest), pc_dest);
pTE->setExpiretime_s(pc_source->skill[MAGERY]/10);
pTE->more1=more1;
pTE->more2=0;
pTE->dispellable=1;
break;
case 5:
if (pc_dest->st<more1)
more1=pc_dest->st;
pc_dest->st-=more1;
pc_dest->hp=min(pc_dest->hp, pc_dest->st);
statwindow(calcSocketFromChar(pc_dest), pc_dest);
pTE->setExpiretime_s(pc_source->skill[MAGERY]/10);
pTE->more1=more1;
pTE->more2=0;
pTE->dispellable=1;
break;
case 6:
//.........这里部分代码省略.........