本文整理汇总了C++中object::WeaponDamage方法的典型用法代码示例。如果您正苦于以下问题:C++ object::WeaponDamage方法的具体用法?C++ object::WeaponDamage怎么用?C++ object::WeaponDamage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::WeaponDamage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FxFireDashStop
func FxFireDashStop(object target, proplist effect, int reason, bool temporary)
{
if(temporary)
return;
target->Unstuck();
target->SetObjectLayer(nil);
target->SetAction("Jump");
ExplosionEffect(effect.Size2, target->GetX(), target->GetY(),0,0,0);
for(var o in FindObjects(Find_Distance(effect.Size2, target->GetX(), target->GetY()), Find_Func("CanBeHit", target)))
{
if(o->GetOwner() == target->GetOwner())
continue;
var angle = Angle(target->GetX(), target->GetY(), o->GetX(), o->GetY());
o->AddFireHitEffect();
o->Fling(Sin(angle, 8), -Cos(angle, 8) - 2);
target->WeaponDamage(o, effect.SpellDamage2);
}
target->CastObjects(Flame, RandomX(6,8), RandomX(10,25));
//effect.marker->RemoveObject();
//effect.clonk->MakeHitable(true);
}
示例2: FxFireDashTimer
func FxFireDashTimer(object target, proplist effect, int time)
{
var a = effect.angle;
var x = target->GetX();
var y = target->GetY();
target->SetPosition(target->GetX() + Sin(a, 6, effect.angle_prec), target->GetY() + -Cos(a, 6, effect.angle_prec));
for(var o in FindObjects(Find_Distance(effect.Size1, x, y), Find_Func("CanBeHit", target)))
{
if(o->GetOwner() == target->GetOwner())
continue;
if(!GetEffect("DashCD", o))
{
o->Fling(0, -5);
AddEffect("DashCD", o, 20, 10);
o->AddFireHitEffect();
target->WeaponDamage(o, effect.SpellDamage1);
}
}
var chaoticspark =
{
Size = PV_Linear(1, 0),
ForceX = PV_KeyFrames(10, 0, PV_Random(-6, 6), 333, PV_Random(-6, -6), 666, PV_Random(6, 6), 1000, PV_Random(-6, 6)),
ForceY = PV_KeyFrames(10, 0, PV_Random(-8, 5), 333, PV_Random(-8, 5), 666, PV_Random(-10, 10), 1000, PV_Random(-10, 15)),
Stretch = PV_Speed(1000, 500),
Rotation = PV_Direction(),
CollisionVertex = 0,
OnCollision = PC_Die(),
R = 255,
G = PV_Linear(255,100),
B = PV_Random(0, 100),
DampingX=950,
DampingY=950,
Alpha = PV_Random(100,180),
BlitMode = GFX_BLIT_Additive
};
CreateParticle("Magic", x + RandomX(-5, 5), y + RandomX(-10, 10), RandomX(25, -25) + target->GetXDir(), RandomX(-25, 12) + target->GetYDir(), 50, chaoticspark, 4);
var firetrailparticles =
{
Prototype = Particles_FireTrail(),
Size = PV_Linear(effect.Size1,0),
BlitMode = GFX_BLIT_Additive,
OnCollision=nil,
};
CreateParticle("Fire", x, y, PV_Random(-7,7), PV_Random(-7,7), 20, firetrailparticles, 3);
var dist = Distance(x, y, effect.startx + effect.tx, effect.starty + effect.ty);
if(dist < 10 || (dist > effect.dist + 1 && time > 10))
{
effect.clonk->SetObjectLayer(nil);
return -1;
}
else
{
//Log("%d %d", dist, effect.dist);
effect.dist = dist;
}
}