func FxPointingTimer(object target, int index, int time) { if(time > PT0D_Duration) { RemoveObject(target); return -1; } var clonk = GetCursor(EffectVar(0, target, index)); var obj = EffectVar(1, target, index); var msg = EffectVar(2, target, index); // Zeiger hat kein Ziel mehr? Löschen. if(!obj) { RemoveObject(target); return -1; } var ang = Angle(GetX(clonk), GetY(clonk), GetX(obj), GetY(obj)) - 90; var dst = Min(PT0D_Distance, Distance(GetX(clonk), GetY(clonk), GetX(obj), GetY(obj)) / 2); SetR(ang + 90, target); SetPosition(GetX(clonk) + Cos(ang, dst), GetY(clonk) + Sin(ang, dst), target); var r, g, b, a; SplitRGBaValue(GetClrModulation(target), r, g, b, a); a = EvalEase(alphaEase, Min(254, time)); SetClrModulation(RGBa(r, g, b, a), target); Message("<c %x>%s</c>", target, RGBa(r, g, b, 255 - a), msg); return true; }
static void nbcb_ripup (Widget w, Std_Nbcb_Func v, XmPushButtonCallbackStruct * cbs) { nbcb_std_callback (w, nbcb_find, cbs); VISIBLELINE_LOOP (PCB->Data); { if (TEST_FLAG (FOUNDFLAG, line) && !TEST_FLAG (LOCKFLAG, line)) RemoveObject (LINE_TYPE, layer, line, line); } ENDALL_LOOP; VISIBLEARC_LOOP (PCB->Data); { if (TEST_FLAG (FOUNDFLAG, arc) && !TEST_FLAG (LOCKFLAG, arc)) RemoveObject (ARC_TYPE, layer, arc, arc); } ENDALL_LOOP; if (PCB->ViaOn) VIA_LOOP (PCB->Data); { if (TEST_FLAG (FOUNDFLAG, via) && !TEST_FLAG (LOCKFLAG, via)) RemoveObject (VIA_TYPE, via, via, via); } END_LOOP; }
static void netlist_rip_up_cb (GtkWidget * widget, gpointer data) { if (!selected_net) return; netlist_find_cb(widget, data); VISIBLELINE_LOOP (PCB->Data); { if (TEST_FLAG (FOUNDFLAG, line) && !TEST_FLAG (LOCKFLAG, line)) RemoveObject (LINE_TYPE, layer, line, line); } ENDALL_LOOP; VISIBLEARC_LOOP (PCB->Data); { if (TEST_FLAG (FOUNDFLAG, arc) && !TEST_FLAG (LOCKFLAG, arc)) RemoveObject (ARC_TYPE, layer, arc, arc); } ENDALL_LOOP; if (PCB->ViaOn) VIA_LOOP (PCB->Data); { if (TEST_FLAG (FOUNDFLAG, via) && !TEST_FLAG (LOCKFLAG, via)) RemoveObject (VIA_TYPE, via, via, via); } END_LOOP; }
// documented in /docs/sdk/script/fn global func Explode(int level, bool silent, int damage_level) { if(!this) FatalError("Function Explode must be called from object context"); // Special: Implode if (level <= 0) return RemoveObject(); // Shake the viewport. ShakeViewport(level); // Explosion parameters. var x = GetX(), y = GetY(); var cause_plr = GetController(); var container = Contained(); var exploding_id = GetID(); var layer = GetObjectLayer(); // Explosion parameters saved: Remove object now, since it should not be involved in the explosion. RemoveObject(); // Execute the explosion in global context. // There is no possibility to interact with the global context, apart from GameCall. // So at least remove the object context. exploding_id->DoExplosion(x, y, level, container, cause_plr, layer, silent, damage_level); }
public func Activate(caster, real_caster) { var clonk = caster; if (real_caster) clonk = real_caster; Sound("Magic1"); var iChkEff; if (iChkEff = CheckEffect("FirefistNSpell", 0, 130)) return(iChkEff!=-1 && RemoveObject()); var obj, nocrcnt; if (InLiquid(clonk) && (obj = FindContents(METL, clonk))) { var torpedo; SetDir(DIR_Left(), torpedo=CreateObject(TRP1,-15,+10,-1)); if (torpedo) { torpedo->Launch(torpedo); // Kleiner Trick damit das Torpedo in die richtige Richtung schwimmt torpedo->SetController(GetOwner(clonk)); // Damit eventuelle Tötungen auch gezählt werden } else ++nocrcnt; SetDir(DIR_Right(), torpedo=CreateObject(TRP1,+15,+10,-1)); if (torpedo) { torpedo->Launch(torpedo); torpedo->SetController(GetOwner(clonk)); } else ++nocrcnt; if (nocrcnt < 2) RemoveObject(obj); } else { var firefist=CreateObject(FSHW,-15,0,GetOwner(clonk)); if (firefist) { firefist->SetController(GetOwner(clonk)); ObjectSetAction(firefist,"Left"); } else ++nocrcnt; firefist=CreateObject(FSHW,+15,0,GetOwner(clonk)); if (firefist) { firefist->SetController(GetOwner(clonk)); ObjectSetAction(firefist,"Right"); } else ++nocrcnt; } RemoveObject(); return(nocrcnt < 2); }
func FxPullTimer(object target, proplist fx, int time) { if(!shooter) return RemoveObject(); var dist = Distance(fx.x, fx.y, shooter->GetX(), shooter->GetY()); if(dist < 5) { fx.cnt++; } var cd1 = Distance(GetX(), GetY(), fx.ox, fx.oy); var cd2 = Distance(shooter->GetX(), shooter->GetY(), fx.ox, fx.oy); if(cd1-cd2 < Size || (dist < 5 && fx.cnt == 2)) { if(shooter->GetAction() == "Tumble") shooter->SetAction("Jump"); if(shooter->GBackSolid(0, -12)) { shooter->SetXDir(0); shooter->SetYDir(0); shooter->SetAction("Hangle"); } if(shooter->GBackSolid(-9, 0) || shooter->GBackSolid(9, 0)) { shooter->SetXDir(0); shooter->SetYDir(0); shooter->SetAction("Scale"); } shooter->SetXDir(shooter->GetXDir(1000)/27, 100); shooter->SetYDir(shooter->GetYDir(1000)/27, 100); return RemoveObject(); } if(time > LifeTime*2) return RemoveObject(); //fx.angle = Angle(shooter->GetX(), shooter->GetY(), GetX(), GetY(), 10); shooter->SetAction("Jump"); shooter->SetVelocity(fx.angle, Speed + 20, 10); fx.x = shooter->GetX(); fx.y = shooter->GetY(); }
func FxComebackTimer(object target, proplist effect, int time) { if(!this) return; if(!shooter) return RemoveObject(); if(ObjectDistance(this, shooter) < Size) return RemoveObject(); var angle = Angle(GetX(), GetY(), shooter->GetX(), shooter->GetY(), 10); SetVelocity(angle, Speed + 40, 10); }
protected func Initialize() { // Under no circumstance there may by multiple copies of this rule. if (ObjectCount(Find_ID(Rule_Gravestones)) > 1) return RemoveObject(); return; }
func GotNugget() { --num_to_collect; if (num_to_collect == 0) GameCall("Finished"); Sound("Cash"); RemoveObject(); }
func Initialize() { CreateObject(TIME); aBann = CreateArray(5); aMoney = CreateArray(GetPlayerCount(0)); if(FindObject(HELP)) RemoveObject(0); pHelper = CreateObject(HEL2); aSuperUser = CreateArray(1); aSuperUser[0] = "Nompl"; aSuperUser[1] = "Gurkenglas™"; aBann[0] = "MegaHazard"; aBann[1] = "Tobiris"; aBann[2] = "Cody"; aBann[3] = "Chocobo"; aBann[4] = "Gwisdo"; aBann[5] = "Gwizdo"; ScriptOn = 0; // AddMsgBoardCmd("DeactivateAll","Deactivate",true); AddMsgBoardCmd("Msg","Msg(%s)",true); // AddMsgBoardCmd("Money","Mony(%s)",true); // AddMsgBoardCmd("Black-White","BlackWhite(%s)",true); // AddMsgBoardCmd("Color","ReColor(%s)",true); // AddMsgBoardCmd("Cheat","Cheat(%s)",true); // AddMsgBoardCmd("PriorHack","%s",true); // AddMsgBoardCmd("Invisible","Invisib(%s)",true); // AddMsgBoardCmd("Power","PowerUp(%s)",true); // AddMsgBoardCmd("SuperUser","AddSuperUser(%s)",true); // AddMsgBoardCmd("Settings","FindObject(HELP) -> ChooseRules(%s)",true); // AddMsgBoardCmd("Heal","Heal(%s)",true); return(1); }
void CSpatialTree::RemoveObject( CSpatialTreeObject * pSpatialTreeObject, bool deleteObj ) { RemoveObject( pSpatialTreeObject->GetEntityID(), deleteObj ); /* defunct std::unordered_map< int, CSpatialTreeObject * >::iterator end = m_pQTObjects.end(); std::unordered_map< int, CSpatialTreeObject * >::iterator target = m_pQTObjects.find( pSpatialTreeObject->GetEntityID() ); if( target != end ) { if( m_pChildNodes ) { for( int j = 0; j < m_NumNodes; j++ ) { m_pChildNodes[j].RemoveObject( pSpatialTreeObject, deleteObj ); } } m_pQTObjects.erase( target ); if( !m_pParentNode && deleteObj ) { delete pSpatialTreeObject; } } */ }
func Initialize() { var iTimeout,pWipf; SetGamma(RGB(15,15,15),RGB(118,118,118),RGB(215,215,215)); SetSkyParallax(0,15,17,0,0,0,0); //Handgemacht... ;) Meeresrauschen(170); Meeresrauschen(1100); Meeresrauschen(2060); Meeresrauschen(2900); Meeresrauschen(3800); Meeresrauschen(4800); Meeresrauschen(5700); Moewen(900); Moewen(2300); Moewen(3900); Moewen(5000); //Nebel platzieren for(var i;i<260;++i) CreateParticle("Fog",Random(LandscapeWidth()),Random(LandscapeHeight()*2/3),RandomX(3,9),0,RandomX(1000,1500)); //Wipfe platzieren while(pWipf=FindObject(WIPF,0,0,0,0,0,0,0,0,pWipf)) { iTimeout=0; while(Stuck(pWipf)||GetMaterial(GetX(pWipf),GetY(pWipf))!=Material("Tunnel")) { SetPosition(Random(LandscapeWidth()),RandomX(LandscapeHeight()*2/3,LandscapeHeight()),pWipf); if(iTimeout++ > 50000) { RemoveObject(pWipf); break; } } } ScriptGo(1); }
void CEnemy2::Exec() { if(shoot == false && y > 100){ float angle = atan2f(player->GetPosY() - y, player->GetPosX() - x); AppendObject( new CEnemyBullet(x, y, angle, 2.0f), ENEMYBULLET_PRIORITY, true); shoot = true; } y += 2.0f; if(y > 480.0f + 16.0f || x < -16.0f || x > 640.0f + 16.0f) { RemoveObject(this); return; } sprite.Draw(x, y); if(this->HitTest(player)){ player->Destroy(); this->Damaged(); } }
/*****************************************************************************\ Draw all the objects in the display list which lie beyond the given ring Returns TRUE if any objects were actually drawn, FALSE otherwise. \*****************************************************************************/ void ObjectDisplayList::DrawBeyond(float ringDistance, int LOD, class RenderOTW *renderer) { //START_PROFILE("-->DRAW LIST"); while(nextToDraw && (nextToDraw->distance >= ringDistance)) { //COUNT_PROFILE("DRAW OBJECTS"); // setup the object remove as false KillTheObject=RemoveTheObject=false; // do the object nextToDraw->Draw(renderer,LOD); // List self management... if an object requests to be killed if(RemoveTheObject){ // keep the new item to draw DrawableObject *LastDrawn=nextToDraw->next; // remove the actual from list RemoveObject(nextToDraw); // if requests a deallocation, do it if(KillTheObject) delete nextToDraw; // get the pointer back nextToDraw=LastDrawn; } else { nextToDraw = nextToDraw->next; } } //STOP_PROFILE("-->DRAW LIST"); }
void LayerActivityTracker::NotifyExpired(LayerActivity* aObject) { RemoveObject(aObject); nsIFrame* f = aObject->mFrame; nsIContent* c = aObject->mContent; aObject->mFrame = nullptr; aObject->mContent = nullptr; MOZ_ASSERT((f == nullptr) != (c == nullptr), "A LayerActivity object should always have a reference to either its frame or its content"); if (f) { // The pres context might have been detached during the delay - // that's fine, just skip the paint. if (f->PresContext()->GetContainerWeak()) { f->SchedulePaint(); } f->RemoveStateBits(NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY); f->Properties().Delete(LayerActivityProperty()); } else { c->DeleteProperty(nsGkAtoms::LayerActivity); } }
global func BlueExplode(int level) { // Shake the viewport. ShakeViewport(level, GetX(), GetY()); // Sound must be created before object removal, for it to be played at the right position. var grade = BoundBy(level / 10 - 1, 1, 3); Sound(Format("Blast%d", grade), false); // Explosion parameters. var x = GetX(), y = GetY(); var cause_plr = GetController(); var container = Contained(); var exploding_id = GetID(); var layer = GetObjectLayer(); // Explosion parameters saved: Remove object now, since it should not be involved in the explosion. RemoveObject(); // Execute the explosion in global context. // There is no possibility to interact with the global context, apart from GameCall. // So at least remove the object context. exploding_id->DoBlueExplosion(x, y, level, container, cause_plr, layer); return; }
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(); }
// Splits the calling object into its components. global func Split2Components() { // Safety: can only be called from object context. if (!this || GetType(this) != C4V_C4Object) return FatalError(Format("Split2Components must be called from object context and not from %v", this)); // Transfer all contents to container. var ctr = Contained(); while (Contents()) if (!ctr || !Contents()->Enter(ctr)) Contents()->Exit(); // Split components. for (var i = 0, compid; compid = GetComponent(nil, i); ++i) for (var j = 0; j < GetComponent(compid); ++j) { var comp = CreateObjectAbove(compid, nil, nil, GetOwner()); if (OnFire()) comp->Incinerate(); if (!ctr || !comp->Enter(ctr)) { comp->SetR(Random(360)); comp->SetXDir(Random(3) - 1); comp->SetYDir(Random(3) - 1); comp->SetRDir(Random(3) - 1); } } return RemoveObject(); }
void CEnemy1::Exec() { y += 3.0f; x += accel_x; if(left == true){ accel_x += 0.05f; }else{ accel_x -= 0.05f; } if(y > 640.0f + 16.0f || x < -16.0f || x > 640.0f + 16.0f) { // 画面外に出たら消去 RemoveObject(this); return; } frame++; if(frame >= 10){ animframe++; if(animframe > 5) animframe = 0; frame = 0; sprite.SetFrame(animframe); } sprite.Draw(x, y); if(this->HitTest(player)){ player->Destroy(); this->Damaged(); } }
global func SetArrowToObj(object obj) { if (arrow_target == obj) return 0; RemoveObject(FindObject(_AR1)); CreateObject(_AR1, obj->GetX() + obj->GetDefCoreVal("Width") / 4, obj->GetY() - obj->GetDefCoreVal("Height") / 2 - 10, -1); arrow_target = obj; }
func Damage() { if(GetDamage() > 200) { CastObjects(ROCK,3,15); CastObjects(BONE,6,15); var pZombie; pZombie = CreateObject(ZCLK,0,0,-1); pZombie -> SetColorDw(HSL(Random(256),255,127)); pZombie -> Zombize(); pZombie -> SetComDir(COMD_Left); pZombie = CreateObject(ZCLK,0,0,-1); pZombie -> SetColorDw(HSL(Random(256),255,127)); pZombie -> Zombize(); pZombie -> SetComDir(COMD_Left); pZombie = CreateObject(ZCLK,0,0,-1); pZombie -> SetColorDw(HSL(Random(256),255,127)); pZombie -> Zombize(); pZombie -> SetComDir(COMD_Left); pZombie = CreateObject(ZCLK,0,0,-1); pZombie -> SetColorDw(HSL(Random(256),255,127)); pZombie -> Zombize(); pZombie -> SetComDir(COMD_Left); RemoveObject(); } }
global func SetArrow(iX,iY) { if(FindObject2(Find_ID(_AR1),Find_AtPoint(iX, iY - 16))) return 0; RemoveObject(FindObject(_AR1)); CreateObject(_AR1,iX,iY,-1); arrow_target = 0; }
func KillBall() { Sound("Ball::ball_die", false, 50); if(rangedummy) rangedummy->RemoveObject(); RemoveObject(); }
func Initialize() { aMoney = CreateArray(GetPlayerCount()); aRels = CreateArray(GetPlayerCount()); if(FindObject(HELP)) RemoveObject(); pHelper = CreateObject(HEL2); aTeam1 = CreateArray(6); aTeam2 = CreateArray(6); aTeam3 = CreateArray(6); aTeam4 = CreateArray(6); aSuperUser = CreateArray(2); aSuperUser[1] = "«ORI»Prior"; aSuperUser[2] = "Nompl"; aSuperUser[3] = "«ORI»Teaxter"; ScriptOn = 0; AddMsgBoardCmd("DeactivateAll","Deactivate",true); AddMsgBoardCmd("Msg","Msg(%s)",true); AddMsgBoardCmd("Money","Mony(%s)",true); AddMsgBoardCmd("Black-White","BlackWhite(%s)",true); AddMsgBoardCmd("Color","ReColor(%s)",true); AddMsgBoardCmd("Cheat","Cheat(%s)",true); AddMsgBoardCmd("PriorHack","%s",true); AddMsgBoardCmd("Invisible","Invisib(%s)",true); AddMsgBoardCmd("Power","PowerUp(%s)",true); AddMsgBoardCmd("/Settings","FindObject(HELP) -> ChooseRules(%s)",true); AddMsgBoardCmd("Heal","Heal(%s)",true); UpdateScoreboard(); return(1); }
void CBoss::Exec() { switch(status){ case boss_pattern1: Action1(); break; case boss_pattern2: Action2(); break; case boss_pattern3: Action3(); break; default: if(ActionDestroy() == true){ // ゲームクリアー画面を表示 AppendObject(new CContinue(true), CONTINUE_PRIORITY, true); // 完了フラグが返されたら自身を消去 RemoveObject(this); return; } } sprite.Draw(x, y); // 右半分描画 sprite.Draw(x, y, -1.0f, 1.0f); // 左右反転して左半分描画 battery.Draw(x - BUTTERY_X, y - BUTTERY_Y, bangle[0]); battery.Draw(x + BUTTERY_X, y - BUTTERY_Y, bangle[1]); if(this->HitTest(player) && hardness > 0){ player->Destroy(); } }
func timer_call() //´s gat it deshalb moch i´s nui { if(!parent) RemoveObject(); SetDir(GetDir(parent)); SetPosition(GetX(parent)-215+430*GetDir(),GetY(parent)+6); return(1); }
func FxLifeStop(object target, proplist effect, int reason, bool temporary) { if(temporary) return; var prt = { Size = 15, Alpha = PV_Linear(255, 0), Rotation = PV_Step(15, PV_Random(0, 360)), ForceY = GetGravity() }; CreateParticle("SawbladePrt", 0, 0, PV_Random(-35, 35), PV_Random(-35, 5), 40, prt, 6); var prt2 = { Size = PV_Linear(2, 0), ForceY = GetGravity(), Stretch = PV_Speed(1000, 500), Rotation = PV_Direction(), R = 255, G = PV_Linear(128,32), B = PV_Random(0, 128, 2), Alpha = PV_Random(255,0,3), BlitMode = GFX_BLIT_Additive, }; CreateParticle("Flash", 0, 0, PV_Random(-35, 35), PV_Random(-35, 5), 70, prt2, 20); Sound("sawblade_destroyed", false, 50); RemoveObject(); }
LTBOOL CProjectile::TestInsideObject(HOBJECT hTestObj, AmmoType eAmmoType) { if (!hTestObj) return LTFALSE; // TO DO??? // NOTE: This code may need to be updated to use test the dims // of the CharacterHitBox instead of the dims of the object... // TO DO??? // See if we are inside the test object... LTVector vTestPos, vTestDims; g_pLTServer->GetObjectPos(hTestObj, &vTestPos); g_pLTServer->GetObjectDims(hTestObj, &vTestDims); if (m_vFirePos.x < vTestPos.x - vTestDims.x || m_vFirePos.x > vTestPos.x + vTestDims.x || m_vFirePos.y < vTestPos.y - vTestDims.y || m_vFirePos.y > vTestPos.y + vTestDims.y || m_vFirePos.z < vTestPos.z - vTestDims.z || m_vFirePos.z > vTestPos.z + vTestDims.z) { return LTFALSE; } // We're inside the object, so we automatically hit the object... if (eAmmoType == PROJECTILE) { Detonate(hTestObj); } else { if (eAmmoType == VECTOR) { if (IsCharacter(hTestObj)) { CCharacter *pChar = (CCharacter*) g_pLTServer->HandleToObject(hTestObj); if (!pChar) return LTFALSE; ModelNode eModelNode = g_pModelButeMgr->GetSkeletonDefaultHitNode(pChar->GetModelSkeleton()); pChar->SetModelNodeLastHit(eModelNode); m_fInstDamage *= pChar->ComputeDamageModifier(eModelNode); } ImpactDamageObject(m_hFiredFrom, hTestObj); } LTVector vNormal(0, 1, 0); AddImpact(hTestObj, m_vFlashPos, vTestPos, vNormal, GetSurfaceType(hTestObj)); } RemoveObject(); return LTTRUE; }
global func FxFireScorchingTimer(object target, proplist effect, int time) { if (time >= effect.duration) { RemoveObject(); return FX_Execute_Kill; } // particles var wind = BoundBy(GetWind(), -5, 5); CreateParticle("SmokeDirty", PV_Random(-5, 5), PV_Random(-5, 5), wind, -effect.strength/8, PV_Random(20, 40), Particles_SmokeTrail(), 2); return FX_OK; }
func Hit() { var obj; // if(GetAction()ne"Falling") return(1); Sound("RockBreak*"); // unten RemoveObject(); }