当前位置: 首页>>代码示例>>C++>>正文


C++ AddEffect函数代码示例

本文整理汇总了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);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:25,代码来源:Script.c

示例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;
	}
开发者ID:TheBlackJokerDevil,项目名称:openclonk,代码行数:33,代码来源:Script.c

示例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, ...);
}
开发者ID:gitMarky,项目名称:caedesmod,代码行数:25,代码来源:Clonk_ActMapHack.c

示例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;
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:25,代码来源:Script.c

示例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();
}
开发者ID:772,项目名称:openclonk,代码行数:27,代码来源:Script.c

示例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();
}
开发者ID:772,项目名称:openclonk,代码行数:32,代码来源:SeqAttack.c

示例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);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:34,代码来源:Script.c

示例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;
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:25,代码来源:Script.c

示例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);
	}
}
开发者ID:MDT-Maikel,项目名称:Knueppeln-Mod,代码行数:28,代码来源:Script.c

示例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);
}
开发者ID:ev1313,项目名称:Widening-III,代码行数:12,代码来源:Object_Fading.c

示例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;
}
开发者ID:TheBlackJokerDevil,项目名称:openclonk,代码行数:7,代码来源:Script.c

示例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);
	}
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:32,代码来源:Script.c

示例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);
}
开发者ID:Meowtimer,项目名称:ChangingWorldRed,代码行数:7,代码来源:Script.c

示例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;
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:7,代码来源:DlgVillageHead.c

示例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();
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:26,代码来源:Script.c


注:本文中的AddEffect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。