您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AddEffect函数代码示例

51自学网 2021-06-01 19:40:50
  C++
这篇教程C++ AddEffect函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例17: Idle

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


示例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,


示例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,


示例20: FxLifeStop

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


示例21: Initialize

func Initialize(){	AddEffect("Sparkle", this, 1, 30 + RandomX(-3, 3), this);	graphics_index = Random(4);	if (graphics_index) SetGraphics(Format("%d", graphics_index+1));	return true;}
开发者ID:sarah-russell12,项目名称:openclonk,代码行数:7,


示例22: InitEffect

func InitEffect(){	Sound("Objects::Weapons::WeaponSwing1", false, 100);	SetLightRange(30, 70);	SetLightColor(RGB(150, 150, 150));	trailparticles =	{		Size = 5,		R = pR,		G = pG,		B = pB,		Attach=ATTACH_Front	};		var angle = Angle(0, 0, GetXDir(), GetYDir());		hookprt = 	{		Size = 8,		R = pR,		G = pG,		B = pB,		Attach=ATTACH_Front|ATTACH_MoveRelative,		Rotation = angle	};			AddEffect("Life", this, 1, LifeTime, this);	hit = false;}
开发者ID:MDT-Maikel,项目名称:Knueppeln-Mod,代码行数:31,


示例23: Construction

protected func Construction(){	_inherited(...);		SetSkin(0);	AddEffect("IntTurn", this, 1, 1, this);	AddEffect("IntEyes", this, 1, 35+Random(4), this);	AttachBackpack();	iHandMesh = [0,0];		SetAction("Walk");	SetDir(Random(2));	// Broadcast for rules	GameCallEx("OnClonkCreation", this);}
开发者ID:sarah-russell12,项目名称:openclonk,代码行数:17,


示例24: Initialize

func Initialize(){	AddEffect("CheckAutoMoveTo", this, 1, 30, this);	AddEffect("ElevatorUpperLimitCheck", this, 1, 1, this);	AddEffect("FetchVehicles", this, 1, 10, this);		case_speed = ElevatorCase_move_speed;	case_speed_automatic = 2 * case_speed;		partner_was_synced = false;		front = CreateObject(Elevator_Case_Front, 0,13, GetOwner());	back = CreateObject(Elevator_Case_Back, 0,13, GetOwner());		front->SetAction("Attach", this);	back->SetAction("Attach", this);}
开发者ID:Meowtimer,项目名称:openclonk,代码行数:17,


示例25: Initialize

func Initialize(){	inherited(...);	SetR(90);	SetGraphics(nil, Javelin);	PlayAnimation("Base", 5, Anim_Const(0), Anim_Const(1000));	AddEffect("HitCheck", this, 1,2, nil,nil);}
开发者ID:clonkspot,项目名称:ClonkFest.ocs,代码行数:8,


示例26: FxProducePowerStart

func FxProducePowerStart(target, effect, temp){	if(temp) return;	MakePowerProducer(Compensator_power_usage);		// todo: effects	AddEffect("Sparkle", this, 1, 1, this);}
开发者ID:notprathap,项目名称:openclonk-5.4.1-src,代码行数:8,


示例27: IntroStart

global func IntroStart(){	if(!g_intro_initialized && !GetEffect("IntIntro"))	{		AddEffect("IntIntro", nil, 1, 2, nil, nil);		g_intro_initialized = true;	}}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:8,


示例28: Departure

protected func Departure(object container){	if (GetID() != Bow) return;	if (container->GetOCF() & OCF_CrewMember)		AddEffect("Fade", this, 100, 1, this);	return _inherited(container, ...);}
开发者ID:Meowtimer,项目名称:openclonk,代码行数:8,


示例29: 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;}
开发者ID:lluchs,项目名称:jcaesar-openclonk,代码行数:8,


示例30: Initialize

func Initialize(){	SetGraphics("Back", Symbol_InfoYourTeamHasBomb, 0, GFXOV_MODE_Base, nil, GFX_BLIT_ClrSfc_OwnClr);	SetGraphics(nil, GetID(), 1, GFXOV_MODE_Base, nil, GFX_BLIT_ClrSfc_OwnClr);		AddEffect("FadeAway", this, 1, 1, this);	this.Parallaxity = [0, 0];	this.Visibility = VIS_Owner;}
开发者ID:gitMarky,项目名称:caedesmod,代码行数:9,



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


C++ AddEmote函数代码示例
C++ AddEasternKingdomsScripts函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。