• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddEffect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AddEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ AddEffect函数的具体用法?C++ AddEffect怎么用?C++ AddEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AddEffect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: AddCyclopsAI

global func AddCyclopsAI(object clonk) // somewhat hacky, but it works
{
	var effect_name = "IntCyclopsAI";
	var fx = GetEffect(effect_name, clonk);
	if (!fx) fx = AddEffect(effect_name, clonk, 1, 2);
	if (!fx || !clonk) return nil;
	
	clonk.ai = fx;

	// bin inventory
	var cnt = clonk->ContentsCount();
	fx.bound_weapons = CreateArray(cnt);
	for (var i=0; i<cnt; ++i) fx.bound_weapons[i] = clonk->Contents(i);

	// set home
	fx.home_x = clonk->GetX();
	fx.home_y = clonk->GetY();
	fx.home_dir = DIR_Left;

	// set guard range
	fx.guard_range = {
                      x = fx.home_x-AI_DefGuardRangeX,
                      y = fx.home_y-AI_DefGuardRangeY,
                      wdt = AI_DefGuardRangeX*2,
                      hgt =  AI_DefGuardRangeY*2};
                      

	fx.spray_old = {time = 0, v0 = 0, v1 = 0, reach = 0};
	fx.spray_cur = {time = 0, v0 = 0, v1 = 0, reach = 0};

	AI->SetMaxAggroDistance(clonk, AI_DefMaxAggroDistance);
	return fx;
}
开发者ID:gitMarky,项目名称:Shire.ocs,代码行数:33,代码来源:Cyclops.c


示例17: Idle

func Idle()
{
	ClearEffects();
	ox=GetX();
	oy=GetY();
	AddEffect("Idle", this, 1, 1, this);
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:7,代码来源:Script.c


示例18: SCopy

C4SoundEffect *C4SoundSystem::GetEffect(const char *szSndName) {
  C4SoundEffect *pSfx;
  char szName[C4MaxSoundName + 4 + 1];
  int32_t iNumber;
  // Evaluate sound name
  SCopy(szSndName, szName, C4MaxSoundName);
  // Default extension
  DefaultExtension(szName, "wav");
  // Convert old style '*' wildcard to correct '?' wildcard
  // For sound effects, '*' is supposed to match single digits only
  SReplaceChar(szName, '*', '?');
  // Sound with a wildcard: determine number of available matches
  if (SCharCount('?', szName)) {
    // Search global sound file
    if (!(iNumber = SoundFile.EntryCount(szName)))
      // Search scenario local files
      if (!(iNumber = Game.ScenarioFile.EntryCount(szName)))
        // Search bank loaded sounds
        if (!(iNumber = EffectInBank(szName)))
          // None found: failure
          return NULL;
    // Insert index to name
    iNumber = BoundBy(1 + SafeRandom(iNumber), 1, 9);
    SReplaceChar(szName, '?', '0' + iNumber);
  }
  // Find requested sound effect in bank
  for (pSfx = FirstSound; pSfx; pSfx = pSfx->Next)
    if (SEqualNoCase(szName, pSfx->Name)) break;
  // Sound not in bank, try add
  if (!pSfx)
    if (!(pSfx = AddEffect(szName))) return NULL;
  return pSfx;
}
开发者ID:ev1313,项目名称:yaC,代码行数:33,代码来源:C4SoundSystem.cpp


示例19: Attach2

global func Attach2(object pObj, object pTarget) {
	// Kein Objekt vorhanden oder schon irgendwo attached?
	if (!pObj || !pTarget && !(pTarget = this) || GetEffect("Attach", pTarget))
		return;
	
	return AddEffect("Attach", pTarget, 1, 1, 0, 0, pObj);
}
开发者ID:lluchs,项目名称:Luftherrschaft,代码行数:7,代码来源:Attach.c


示例20: FxLifeStop

func FxLifeStop()
{
	if(!GetEffect("Pull", this))
	{
		AddEffect("Comeback", this, 1, 1, this);
	}
}
开发者ID:MDT-Maikel,项目名称:Knueppeln-Mod,代码行数:7,代码来源:Script.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddEmote函数代码示例发布时间:2022-05-30
下一篇:
C++ AddEasternKingdomsScripts函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap