本文整理汇总了C++中object::GetOCF方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetOCF方法的具体用法?C++ object::GetOCF怎么用?C++ object::GetOCF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::GetOCF方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Departure
protected func Departure(object container)
{
if (GetID() != Bow) return;
if (container->GetOCF() & OCF_CrewMember)
AddEffect("Fade", this, 100, 1, this);
return _inherited(container, ...);
}
示例2: DoDmg
global func DoDmg(int iDmg, int iType, object pTarget, int iPrecision, int dmgplayer)
{
if(!pTarget)
if(!(pTarget = this()))
return(0);
if(!iPrecision)
iPrecision = 10;
var dmg;
var dmgdealer = dmgplayer-1;
if(dmgdealer < 0)
dmgdealer = GetController(pTarget);
var red = pTarget->~OnDmg(iDmg, iType); //reduction
// reduction
dmg = iDmg*(100-red)*iPrecision;
// Killer setzen
if(this() && pTarget->GetOCF() & OCF_CrewMember || dmgplayer)
{
SetKiller(dmgdealer, pTarget);
}
//Schaden machen
var pFrom;
//if(pTarget != this())
pFrom = this;
pTarget->~LastDamageType(iType);
pTarget->~OnHit(dmg/1000, iType, pFrom,dmg);
// testweise: Schadensdings
//var rgb = RGB(255,0,0);
//if(dmg/1000 != 0){
// if(dmg < 0) rgb = RGB(0,255,0);
// CreateObject(CMBT,AbsX(GetX(pTarget)),AbsY(GetY(pTarget)),-1) -> Set(0, Format("%d",dmg/1000), rgb);
//}
if(GetCategory(pTarget) & C4D_Living)
return(DoEnergy(-dmg,pTarget, true));
return(DoDamage(dmg/1000,pTarget));
}
示例3: DoDmg
global func DoDmg(int iDmg, int iType, object pTarget, int iPrecision, int dmgplayer, id idKillIcon, int iKillAttachment)
{
//Existenz bestätigen
if(!pTarget)
if(!(pTarget = this))
return;
if(!iPrecision)
iPrecision = 10;
var dmg, dmgdealer = dmgplayer-1;
if(dmgdealer < 0)
dmgdealer = GetController(pTarget);
var red = pTarget->~OnDmg(iDmg, iType);
dmg = iDmg*(100-red)*iPrecision;
if(!dmg || red == 100) return;
//Killer setzen
if(this && pTarget->GetOCF() & OCF_CrewMember || dmgplayer)
SetKiller(dmgdealer, pTarget);
if(GetOCF(pTarget) & OCF_CrewMember)
{
if(!idKillIcon && this)//Kein Killicon?
{
idKillIcon = this->~GetKillIcon();
if(!idKillIcon)
idKillIcon = GetID(this);
if(idKillIcon->~IsClonk())
idKillIcon = 0;
}
if(!idKillIcon)
{
if(iType)
{
if(iType == DMG_Fire)
idKillIcon = GSAM;
else if(iType == DMG_Explosion)
idKillIcon = BOOM;
else if(iType == DMG_Energy)
idKillIcon = ENAM;
else if(iType == DMG_Bio)
idKillIcon = GLOB;
else if(iType == DMG_Projectile)
idKillIcon = STAM;
}
else
idKillIcon = KAMB;
}
pTarget->~KillIcon(idKillIcon);
pTarget->~KillAttachment(iKillAttachment, true);
}
//Schaden machen
var pFrom;
if(pTarget != this)
pFrom = this;
if(!pFrom) pFrom = GetCrew(dmgdealer);
//Wird gerade eingeblendet: Entfernen
if(GetEffect("FadeIn4K", this))
{
EffectVar(0, this, GetEffect("FadeIn4K", this)) = 0;
SetClrModulation(RGBa(255, 255, 255, 0), this);
}
pTarget->~LastDamageType(iType);
pTarget->~OnHit(dmg/1000, iType, pFrom);
if(GetCategory(pTarget) & C4D_Living)
return DoEnergy(-dmg, pTarget, true, 0, dmgplayer);
return DoDamage(dmg/1000, pTarget, 0, dmgplayer);
}