本文整理汇总了C++中object::GetOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetOwner方法的具体用法?C++ object::GetOwner怎么用?C++ object::GetOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::GetOwner方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanBeHit
func CanBeHit(object from)
{
if(from && from->GetOwner() != GetOwner() && GetPlayerTeam(GetOwner()) && FindObject(Find_ID(Rule_NoFriendlyFire)))
{
if(GetPlayerTeam(GetOwner()) == GetPlayerTeam(from->GetOwner()))
return false;
}
return true;
}
示例2: Interact
public func Interact(object clonk)
{
if (!dlg_interact || !dlg_name)
return inherited(clonk, ...);
var guide = FindObject(Find_ID(TutorialGuide), Find_Owner(clonk->GetOwner()));
if (!guide)
return inherited(clonk, ...);
if (dlg_status == DLG_Status_Stop)
{
if (this.guide_was_shown)
{
this.guide_was_shown = false;
guide->ShowGuide();
}
}
else if (dlg_status != DLG_Status_Remove && dlg_status != DLG_Status_Wait)
{
if (!guide->IsHidden())
{
this.guide_was_shown = true;
guide->HideGuide();
}
}
return inherited(clonk, ...);
}
示例3: 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);
}
示例4: CreateConstructionMenu
/** Creates a consruction menu for the calling object. This is supposed to be a crew member,
controlled by a player.
@param producer the producer for which to create the production menu.
@return a pointer to the created menu, or \c nil if failed.
*/
global func CreateConstructionMenu(object constructor, bool create_at_mouse_pos)
{
// Safety checks.
if (!this) return;
if (!(GetOCF() & OCF_CrewMember)) return;
if (!(this->~HasMenuControl())) return;
// Create the menu controller.
var controller = CreateObject(Library_ConstructionMenu);
controller->SetMenuObject(this);
this->SetMenu(controller);
controller->SetCommander(constructor);
if(create_at_mouse_pos)
{
var xy = GetPlayerCursorPos(constructor->GetOwner());
if(xy)
controller->SetPosition(xy[0],xy[1],true);
}
// Add all possible structures to the menu.
controller->AddMenuStructures(constructor, this);
// Show and return production menu.
controller->Show();
return controller;
}
示例5: ControlUse
public func ControlUse(object pClonk, int ix, int iy)
{
AddEffect("Frostbolt", nil, 100, 1, nil, GetID(), pClonk->GetOwner(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY());
Sound("Fireball");
Sound("Fireball");
RemoveObject();
return 1;
}
示例6: Special3
func Special3(object clonk, int x, int y, bool released, bool mouseclick, bool abletocast, bool cooldown)
{
if(!released && !mouseclick && abletocast && !cooldown)
{
Sound("UI::Error", false, 50, clonk->GetOwner());
return 0;
}
return 0;
}
示例7: Launch
func Launch(object clonk, int x, int y)
{
if(clonk.TimeTravelMark == nil)
{
clonk.TimeTravelMark = [clonk->GetX(), clonk->GetY()];
clonk.timeposfx = AddEffect("TravelPos", clonk, 1, 1, nil, GetID(), Size);
clonk.timeposfx.size = Size;
clonk.timeposfx.dur = Dur;
clonk->Sound("travel_pos", false, 30, clonk->GetOwner());
RemoveObject();
return 1;
}
示例8: Launch
func Launch(object clonk, int x, int y)
{
shooter = clonk;
SetController(clonk->GetOwner());
TargetAngle = Angle(0, 0, x, y);
ImaCharginMaLazor(0, 0, Sin(TargetAngle, MaxLength), Cos(TargetAngle, MaxLength) * -1, TargetAngle);
clonk->Charge(this, "ChargeStop", ChargeDuration, {});
AddEffect("PreLazor", this, 1, 2, this, nil);
Sound("Flash::charge", nil, nil, nil, nil, nil, 20);
}
示例9: Special2
func Special2(object clonk, int x, int y, bool released, bool mouseclick, bool abletocast, bool cooldown)
{
if (released || mouseclick || cooldown) return;
var existing = FindObjects(Find_ID(StickyBomb), Find_Owner(clonk->GetOwner()));
if (existing)
{
SoundAt("UI::Click");
for (var bomb in existing)
bomb->BlowUp();
return;
}
}
示例10: Special3
func Special3(object clonk, int x, int y, bool released, bool mouseclick, bool abletocast, bool cooldown)
{
var props =
{
Alpha = 40,
Size = Special3Spell.SpellRange*2,
BlitMode = GFX_BLIT_Additive,
Rotation = PV_Step(10, 0, 1),
Attach = ATTACH_Back | ATTACH_MoveRelative
};
props = Particles_Colored(props, GetPlayerColor(clonk->GetOwner()));
return CastSpellWithSpellRange(clonk, x, y, released, mouseclick, abletocast, cooldown, props, Special3Spell);
}
示例11: ActivateEntrance
protected func ActivateEntrance(object obj)
{
if (this->~IsBase() && this->~CanBlockEnemies())
{
var for_plr = obj->GetOwner();
if (Hostile(GetOwner(), for_plr))
{
Sound("Error", false, 100, for_plr);
PlayerMessage(for_plr, "$TxtNoEntryEnemy$", GetPlayerName(GetOwner()));
return false;
}
}
if (ActIdle())
SetAction("OpenDoor");
return true;
}
示例12: ControlUse
func ControlUse(object clonk, x, y)
{
var objdef = clonk.ObjectSpawnDefinition;
if (objdef == Marker)
{
var marker = clonk->PlaceNewMarker();
if (marker) marker->SetPosition(clonk->GetX() + x, clonk->GetY() + y);
}
else
{
clonk->CreateObject(objdef, x, y);
}
Sound("UI::Click", true, nil, clonk->GetOwner());
}
示例13: JumpEffect
func JumpEffect(object clonk, dir)
{
var from, to;
if (dir == "Up")
{
from = 50;
to = 130;
}
if (dir == "Left")
{
from = -30;
to = 50;
}
if (dir == "Right")
{
from = 130;
to = 210;
}
if (dir == "Down")
{
from = 230;
to = 310;
}
clonk->Sound("Fire::Inflame", false, 30, nil, nil, nil, -100);
var trailparticles =
{
Size = PV_Linear(0, 20),
Alpha = PV_Linear(255, 0),
OnCollision = PC_Die(),
CollisionVertex = 0,
DampingX = 900, DampingY = 900,
BlitMode = GFX_BLIT_Additive
};
trailparticles = Particles_Colored(trailparticles, GetPlayerColor(clonk->GetOwner()));
for(var i = from; i < to; i+=5)
{
var r = 10;
var x = Cos(i, r);
var y = Sin(i, r);
clonk->CreateParticle("Shockwave", x, y, Cos(i, r), Sin(i, r), 60, trailparticles, 2);
}
}
示例14: BlockEffect
func BlockEffect(object clonk, int radius)
{
var trailparticles =
{
Size = PV_KeyFrames(0, 0, 0, 200, PV_Random(10, 25), 1000, 0),
Alpha = PV_Linear(255, 0),
OnCollision = PC_Die(),
CollisionVertex = 0,
DampingX = 900, DampingY = 900,
BlitMode = GFX_BLIT_Additive
};
trailparticles = Particles_Colored(trailparticles, GetPlayerColor(clonk->GetOwner()));
clonk->CreateParticle("Shockwave",
PV_Sin(PV_Random(0, 360, 0, 1), PV_Random(radius - 1, radius + 1, 0, 2)),
PV_Cos(PV_Random(0, 360, 0, 1), PV_Random(radius - 1, radius + 1, 0, 2)),
PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(20, 30), trailparticles, 100);
}
示例15: FxBallShieldStart
func FxBallShieldStart(object target, proplist effect, int temporary)
{
effect.dummy = CreateObject(Dummy, target->GetX(), target->GetY(), target->GetOwner());
effect.dummy.Visibility = VIS_All;
effect.dummy->SetAction("HangOnto", target);
effect.shield = ShieldAmount;
effect.cancel = false;
var props =
{
R = 0,
G = 0,
B = 255,
Alpha = 255,
Size = 40,
BlitMode = GFX_BLIT_Additive,
Rotation = PV_Step(10, 0, 1),
Attach = ATTACH_Back | ATTACH_MoveRelative
};
effect.dummy->CreateParticle("Shockwave", 0, 0, 0, 0, 0, props);
}