本文整理匯總了C++中AddEffect函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddEffect函數的具體用法?C++ AddEffect怎麽用?C++ AddEffect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddEffect函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ChargeStop
func ChargeStop(proplist params)
{
SetAction("Idle");
var angle = params.new_angle;
SetVelocity(angle, Speed-10, 10);
Sound("sawblade_launch", false, 100);
AddEffect("CheckEnemies", this, 1,1, this);
SetLightRange(30, 70);
SetLightColor(RGB(150, 150, 150));
AddEffect("Life", this, 20, LifeTime, this);
/*if(GetXDir() > 0)
SetRDir(15);
else
SetRDir(-15);*/
SetClrModulation(RGBa(255,255,255,255));
Sound("sawloop", false, 20, nil, 1);
AddEffect("Rotate", this, 1, 1, this);
}
示例2: Initialize
private func Initialize()
{
// Create dynamite below the first lava basin
DrawMaterialQuad("Tunnel",1378,1327-5,1860,1327-5,1860,1330,1387,1330,1);
//Sound("Environment::BirdsLoop",true,100,nil,+1);
Cloud->Place(40);
PlaceObjects(Rock,50,"Earth");
PlaceObjects(Loam,25,"Earth");
PlaceObjects(Nugget,25,"Earth");
AddEffect("PlaneReset",CreateObjectAbove(Airplane,3030,315,0),100,10,nil,nil);
AddEffect("PlaneReset",CreateObjectAbove(Airplane,3160,315,1),100,10,nil,nil);
Doors();
var concierge = CreateObjectAbove(Clonk, 70, 1030, NO_OWNER);
concierge->SetDir(DIR_Left);
concierge->SetAlternativeSkin("Mime");
concierge->SetObjectLayer(concierge);
concierge->SetName("$NameConcierge$");
concierge->SetDialogue("Concierge");
concierge->Sound("Circus", false, nil, nil, +1, 100);
Dialogue->FindByTarget(concierge)->AddAttention();
var cannons = FindObjects(Find_ID(Cannon));
for (var cannon in cannons)
{
cannon->TurnCannon(0);
cannon->SetCannonAngle(45000);
cannon.Touchable = false;
}
示例3: Hit
func Hit(int oldx, int oldy)
{
if (IsJumping())
{
if (GetContact(-1, CNAT_Right))
{
SetXDir(-10);
SetYDir(oldy, 100);
AddEffect("CheckComDir", this, 1, 1, this);
}
else if (GetContact(-1, CNAT_Left))
{
SetXDir(10);
SetYDir(oldy, 100);
AddEffect("CheckComDir", this, 1, 1, this);
}
else if (GetContact(-1, CNAT_Top) && (oldy < 0))
{
SetXDir(oldx, 100);
SetYDir(+5);
}
}
return inherited(oldx, oldy, ...);
}
示例4: InitializePlayer
func InitializePlayer(int plr)
{
// Create buildings
the_elevator = CreateConstruction(ELEV,165,110,0,80,1);
valley_cata = CreateObject(CATA,240,387,0);
hill_cata = CreateObject(CATA,540,247,0);
valley_wood = CreateObject(WOOD,280,390,NO_OWNER);
CreateObject(METL,285,390,NO_OWNER);
// Remember clonks
constructor_clnk = GetCrew(plr,0);
valley_clnk = GetCrew(plr,1);
catapult_clnk = GetCrew(plr,2);
// Move valley and catapult clonk
Exit(valley_clnk,230,390);
Exit(catapult_clnk,520,250);
// Prevent constructor and catapult clonks from falling down
var hr = AddEffect("StayNearElev", constructor_clnk, 1, 30, 0, 0, 0, 0, 0, 0);
AddEffect("StayNearCata", catapult_clnk, 1, 30);
// Message and control positioning
SetPlrShowControlPos(plr, SHOWCTRLPOS_Top);
SetTutorialMessagePos(MSG_Bottom | MSG_Left | MSG_XRel | MSG_WidthRel, 10, -10, 35);
// Start script
ScriptGo(1);
return true;
}
示例5: Init
func Init(to, max, cur, timeout, offset, visibility, proplist data)
{
maximum = max;
current = cur;
timeout_time = timeout;
width = data.width ?? 40;
height = data.height ?? 5;
if(timeout_time)
{
var e = AddEffect("TimeOut", this, 1, BoundBy(timeout_time/2, 5, 35), this);
e.t = timeout_time;
}
this.Visibility = visibility;
SetGraphics(nil, GetID(), 1, GFXOV_MODE_Base, nil, GFX_BLIT_Custom);
SetBarColor(data.color, data.back_color);
SetAction("Attach", to);
SetVertexXY(0, -offset.x, -offset.y);
AddEffect("LifeCheck", to, 1, 0, this);
Update();
}
示例6: Attack_5
func Attack_5()
{
if (this.planes[0]->GetX() > 880) return ScheduleSame(5);
MessageBoxAll("$Attack3$", npc_lara, true); // oh god!
for (var i=0; i<3; ++i)
{
this.planes[i]->StartInstantFlight(270, 15);
this.planes[i]->SetXDir(-15);
this.planes[i]->SetYDir(0);
}
SetViewTarget(g_flagpole);
// NPCs go nuts
RemoveEffect("NewtonHammering", npc_newton);
RemoveEffect("LaraWalking", npc_lara);
RemoveEffect("WoodyWalking", npc_woody);
AddEffect("Attack_Panic", npc_newton, 1, 30, this);
AddEffect("Attack_Panic", npc_lara, 1, 35, this);
AddEffect("Attack_Panic", npc_woody, 1, 40, this);
AddEffect("Attack_Panic", npc_lisa, 1, 45, this);
// Update dialogues; remove attention markers
for (var npc in [npc_newton, npc_lara, npc_woody, npc_lisa, npc_rocky])
{
var dlg = Dialogue->FindByTarget(npc);
if (dlg)
{
dlg->RemoveAttention();
dlg->SetDialogueProgress(100);
}
}
// Start dropping bombs immediately
return CallNext();
}
示例7: Initialize
func Initialize()
{
AddEffect("DefMana", nil, 1, 4, nil);
InitTeamExclusiveChamps(2);
InitScoreboard();
team_score = CreateArray(2);
var fx = AddEffect("CheckWipf", this, 1, 5, this);
fx.counter = resetTime;
var pos = GameCall("LeftGoalPos");
leftgoal = CreateObject(Dummy, pos[0], pos[1], -1);
leftgoal.Visibility = VIS_All;
var fxl = AddEffect("GoalCheck", leftgoal, 1, 1, this, nil, 1, 2);
fxl.teamid = 1;
fxl.enemy = 2;
leftshield_params = GameCall("LeftShieldParams");
leftshield = CreateObject(PortalWall,leftshield_params[0], leftshield_params[1],-1);
pos = GameCall("RightGoalPos");
rightgoal = CreateObject(Dummy, pos[0], pos[1], -1);
rightgoal.Visibility = VIS_All;
var fxr = AddEffect("GoalCheck", rightgoal, 1, 1, this, nil, 2, 1);
fxr.teamid = 2;
fxr.enemy = 1;
rightshield_params = GameCall("RightShieldParams");
rightshield = CreateObject(PortalWall,rightshield_params[0],rightshield_params[1],-1);
SpawnBall();
ScheduleCall(this, "Set", 80);
}
示例8: Initialize
protected func Initialize()
{
// Goal.
CreateObject(Goal_LastManStanding);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
GetRelaunchRule()
->SetRespawnDelay(3)
->SetLastWeaponUse(false);
// Enviroment.
CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);
SetSkyAdjust(RGB(255, 128, 0));
SetSkyParallax(1, 20, 20, 0, 0, nil, nil);
CreateObjectAbove(Column, 160, 304)->SetClrModulation(RGB(255, 100, 80));
CreateObjectAbove(Column, 448, 272)->SetClrModulation(RGB(255, 100, 80));
SetMatAdjust(RGB(255, 150, 128));
AddEffect("RandomMeteor", nil, 100, 20);
AddEffect("DangerousLava", nil, 100, 1);
PlaceEdges();
PlaceGras();
return;
}
示例9: CheckForEnemies
func CheckForEnemies(Size)
{
for(var o in FindObjects(Find_Distance(Size), Find_Func("CanBeHit", this)))
{
if(o->GetOwner() == GetOwner() || GetEffect("BallHitCD", o))
continue;
AddEffect("BallHit", o, 20, 1, nil, BallsMan);
o->Fling(0, -2);
AddEffect("BallHitCD", o, 1, 15);
var trailparticles =
{
Prototype = Particles_ElectroSpark2(),
Size = PV_Linear(PV_Random(5,15),0),
BlitMode = GFX_BLIT_Additive,
Rotation = PV_Random(0,360),
R = pR,
G = pG,
B = pB,
};
CreateParticle("Lightning", o->GetX() - GetX(), o->GetY() - GetY(), 0, 0, 10, trailparticles, 5);
WeaponDamage(o, SpellDamage);
Sound("Ball::ball_hit", false, 50);
}
}
示例10: FadeIn
global func FadeIn(object pObject, int level, bool fFast, int iAmount) {
if (!pObject) {
pObject = this;
}
if (GetEffect("*FadeIn*", pObject)) {
return;
}
if (fFast) {
return AddEffect("FadeIn", pObject, 101, 1,0,0,level, iAmount);
}
return AddEffect("FadeIn", pObject, 101, 2,0,0,level, iAmount);
}
示例11: CreateWaterfall
global func CreateWaterfall(int x, int y, int strength, string mat)
{
var fall = CreateObjectAbove(Waterfall, x, y, NO_OWNER);
if (!mat) mat = "Water";
AddEffect("IntWaterfall", fall, 100, 1, fall, nil, x, y, strength, mat);
return fall;
}
示例12: FxCheckEnemiesTimer
func FxCheckEnemiesTimer(object target, proplist effect, int time)
{
for(var o in FindObjects(Find_Distance(Size), Find_Not(Find_ID(Hook)), Find_Or(Find_Func("IsReflectable"), Find_Func("CanBeHit", this))))
{
if(GetEffect("SawBladeCD", o) || (o->GetOwner() == GetOwner() && time < 15))
{
continue;
}
var angle = Angle(GetX(), GetY(), o->GetX(), o->GetY());
AddEffect("SawBladeCD", o, 1, 25);
if(!o->GetAlive())
{
if(o->~IsWallElement())
continue;
var speed = Distance(0, 0, o->GetXDir(), o->GetYDir());
o->SetVelocity(angle, speed);
o->~Blocked(this);
WeaponDamage(o, SpellDamage);
Sound("Hits::GeneralHit*", false, 50);
continue;
}
Sound("Objects::Weapons::WeaponHit*", false, 50);
o->Fling(Sin(angle, 8), -Cos(angle, 8));
WeaponDamage(o, SpellDamage);
}
}
示例13: Initialize
protected func Initialize()
{
var rand=1;
if(Random(2) == 1)rand=-1;
SetObjDrawTransform(1000*rand,0,0,0,1000);
AddEffect("IntSparks", this, 1, 60, this);
}
示例14: Dlg_VillageHead_Init
public func Dlg_VillageHead_Init(object clonk)
{
var lantern = clonk->CreateContents(Lantern);
lantern->TurnOn();
AddEffect("IntVillageHead", clonk, 100, 5, this);
return true;
}
示例15: ChargeStop
func ChargeStop(proplist params)
{
var eff = AddEffect("FireDash", params.clonk, 20, 1 ,nil, GetID());
eff.angle = params.angle;
eff.dist = Distance(0,0, params.x, params.y);
eff.SpellDamage1 = SpellDamage1;
eff.SpellDamage2 = SpellDamage2;
eff.Size1 = Size1;
eff.Size2 = Size2;
eff.startx = params.clonk->GetX();
eff.starty = params.clonk->GetY();
eff.tx = params.x;
eff.ty = params.y;
eff.marker = params.marker;
eff.clonk = params.clonk;
eff.angle_prec = angle_prec;
if(this)
{
params.clonk->SetAction("Float");
params.clonk->SetObjectLayer(params.clonk);
}
Sound("Fire::Fireball", false, 100);
RemoveObject();
}