func InitializePlayer(int iPlayer) { _inherited(); var pClonk; if(GetPlayerTeam(iPlayer) == 1) { pClonk = CreateObject(JAFA,0,0,iPlayer); pClonk -> Enter(FindObject(GOEB,0,0,LandscapeWidth(),LandscapeHeight()/2)); MakeCrewMember(pClonk,iPlayer); CreateContents(FLAG,pClonk); SetCursor(iPlayer,pClonk); pClonk = CreateObject(JAFA,0,0,iPlayer); pClonk -> Enter(FindObject(GOEB,0,0,LandscapeWidth(),LandscapeHeight()/2)); MakeCrewMember(pClonk,iPlayer); } if(GetPlayerTeam(iPlayer) == 2) { pClonk = CreateObject(WRAT,0,0,iPlayer); pClonk -> Enter(FindObject(GOEB,0,LandscapeHeight()/2,LandscapeWidth(),LandscapeHeight()/2)); MakeCrewMember(pClonk,iPlayer); CreateContents(FLAG,pClonk); SetCursor(iPlayer,pClonk); pClonk = CreateObject(WRAT,0,0,iPlayer); pClonk -> Enter(FindObject(GOEB,0,LandscapeHeight()/2,LandscapeWidth(),LandscapeHeight()/2)); MakeCrewMember(pClonk,iPlayer); } }
void TestScene::Init() { font = new DxFont(); this->AppendObject(font, 1, true); this->AppendItemBox("font", font); tex = new Texture("soccerball.png"); sprite = new Sprite(tex); this->AppendItemBox("tex", tex); this->AppendItemBox("sprite", sprite); r=0.f; AppendObject(new BGMusic("Kalimba.mp3"), 5, "BGM", true); AppendItemBox("BGM", FindObject("BGM")); bgm = dynamic_cast<BGMusic*>(this->FindItemBox("BGM")); //if(bgm) bgm->Play(); input = (Input*)FindObject("input"); if(input == NULL){ input = new Input(); AppendObject(input, 0, "input", true); } sound.Load("missile.wav"); Sound *se = new Sound(*(Sound*)FindItemBox("burst")); //se->EnableDeleteByEnd(); se->Play(); }
func Intro_Stop() { // Lava gets quiet after intro var lava = FindObject(Find_ID(BoilingLava)); if (lava) lava->SetIntensity(25); // if players got stuck somewhere, unstick them for (var i=0; i<GetPlayerCount(C4PT_User); ++i) { var plr = GetPlayerByIndex(i, C4PT_User); var crew = GetCrew(plr); if (crew && !Inside(crew->GetX(),125,170)) { crew->SetPosition(135+Random(25), 860); } crew->Extinguish(); crew->DoEnergy(100); } this.dialogue->SetInteraction(true); this.dialogue->AddAttention(); SetPlayerZoomByViewRange(NO_OWNER, 400,300, PLRZOOM_Set); // Turn and relocate the airplane to make starting it easier. var plane = FindObject(Find_ID(Airplane)); if (plane) { plane->FaceLeft(); plane->SetR(-90); plane->SetPosition(1387, 345); } return true; }
global func FxBoomAttackTimer(object target, effect, int time) { var wave = 1+time/35/Boomattack_wave_delay; if(time/35 % Boomattack_wave_delay == 1) { var gol = FindObject(Find_ID(Goal_SaveTheWindmills)); if(gol) gol->SetWave(wave); if (wave < 13) { CustomMessage(Format(" $MsgWave$ ",wave),nil,NO_OWNER); var wave_strength = Sqrt(9+GetPlayerCount()*time/Boomattack_attack_growth); CreateAttackWave( Random(360) , wave_strength,Boomattack_angle_spread); } else if (wave == 13) { CustomMessage(" $MsgBoss$ ",nil,NO_OWNER); CreateAttackWave( Random(360) , -1, Boomattack_angle_spread); var gol = FindObject(Find_ID(Goal_SaveTheWindmills)); if(gol) gol->BossAttacks(); } } }
func Script80() { var pHut = FindObject(HUT2); if(!FindObject(0,pHut->GetX()-80,pHut->GetY()-50,100,100,OCF_CrewMember)) { goto(80); return; } SetPlrShowControl(0,"____4_678_ 4 678 ____4_____"); TutorialMessage("$TxtStopexactlyinfrontof$"); goto(110); }
protected func Initialize() { // Anfangsgeldwert value=GetWealth(GetOwner()); if(Local(CheckTeam(GetOwner()), FindObject(TACC))) value = Local(CheckTeam(GetOwner()), FindObject(TACC)); else Local(CheckTeam(GetOwner()), FindObject(TACC)) = value; SetWealth(GetOwner(), value); }
// // Simulation // Bool TrackCam::Simulate(FamilyNode *viewNode, F32 time) { Bool bindMod1 = Common::Input::GetModifierKey(1); Bool bindMod2 = Common::Input::GetModifierKey(2); if (trackObj.Alive()) { // Check that we are allowed to track this object if (!CanTrack(trackObj)) { trackObj = FindObject(trackObj, FO_NEXT); } } else { // If object is dead, go to next object trackObj = FindObject(trackObj, FO_NEXT); } if (trackObj.Alive()) { switchDelay = DEFAULT_SWITCH_DELAY; if (rScroll) { if (bindMod1 && bindMod2) { SetRadius(targetRadius + (F32(dy) * time * swoopRate * 2.0F)); } else if (!bindMod1 && !bindMod2) { if (dx) { // Circle about the object qView.Rotate(time * F32(-dx) * DEG2RAD * spinRate, Matrix::I.up); } if (dy) { SetPitch(pitch + (time * F32(-dy) * DEG2RAD * spinRate)); } } else if (Input::GetKeyState() & Input::LBUTTONDOWN) { // Circle about the object SetRadius(targetRadius + (F32(dy) * time * swoopRate * 2.0F)); // Set mouse to centre of screen Input::SetMousePos(Vid::backBmp.Width() >> 1, Vid::backBmp.Height() >> 1); } // Set mouse to centre of screen Input::SetMousePos(Vid::backBmp.Width() >> 1, Vid::backBmp.Height() >> 1); }
func Script5() { SetPlrShowControl(0,"___345678_ 345678 __________"); TutorialMessage("$TxtTheskyislandinthecen$"); // Positionen speichern iBlnX = FindObject(BALN)->GetX(); iBlnY = FindObject(BALN)->GetY(); iPlrX = FindObject(CLNK)->GetX(); iPlrY = FindObject(CLNK)->GetY(); iCounter = 20; }
void KVCanvas::ProfileX(TH2* hh) { TObject* pfx = 0; if ((pfx = FindObject(Form("%s_pfx", hh->GetName())))) pfx->Delete(); hh->ProfileX("_pfx", 1, -1, "i,d,same"); if ((pfx = FindObject(Form("%s_pfx", hh->GetName()))))((TProfile*)pfx)->SetLineColor(kBlack); Modified(); Update(); }
func Script84() { if (FindObject(HUT3)->GetBase()) return(goto(84)); Sound("Applause"); TutorialMessage("$TxtExcellent$"); FindObject(SCRG)->Fulfill(); SetNextMission("Tutorial.c4f\\Tutorial03.c4s", "$BtnNextTutorial$", "$BtnNextTutorialDesc$"); return(1); }
protected func Initialize() { // Environment CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36); GetRelaunchRule()->SetLastWeaponUse(false); var time=CreateObject(Time); time->SetTime(); time->SetCycleSpeed(); FindObject(Find_ID(Moon))->SetMoonPhase(3); FindObject(Find_ID(Moon))->SetCon(150); FindObject(Find_ID(Moon))->SetPosition(LandscapeWidth()/2,150); // Goal: Capture the flag, with bases in both hideouts. var goal = CreateObject(Goal_CaptureTheFlag, 0, 0, NO_OWNER); goal->SetFlagBase(1, 135, 266); goal->SetFlagBase(2, LandscapeWidth() - 135, 266); CreateObject(Rule_KillLogs); var gate = CreateObjectAbove(StoneDoor, 345, 272, NO_OWNER); gate->SetClrModulation(RGB(140,185,255)); gate->SetAutoControl(1); var gate = CreateObjectAbove(StoneDoor, LandscapeWidth()-344, 272, NO_OWNER); gate->SetClrModulation(RGB(140,185,255)); gate->SetAutoControl(2); // Chests with weapons. var chest; chest = CreateObjectAbove(Chest, 60, 220, NO_OWNER); chest->MakeInvincible(); AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,false); chest = CreateObjectAbove(Chest, 150, 370, NO_OWNER); chest->MakeInvincible(); AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,true); chest = CreateObjectAbove(Chest, LandscapeWidth() - 60, 220, NO_OWNER); chest->MakeInvincible(); AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,false); chest = CreateObjectAbove(Chest, LandscapeWidth() - 150, 370, NO_OWNER); chest->MakeInvincible(); AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,true); chest = CreateObjectAbove(Chest, LandscapeWidth()/2, 320, NO_OWNER); chest->MakeInvincible(); AddEffect("FillOtherChest", chest, 100, 5 * 36); AddEffect("SnowyWinter", nil, 100, 1); Sound("Environment::WindLoop",true,20,nil,+1); AddEffect("GeysirExplosion", nil, 100, 1); // Brick edges, notice the symmetric landscape. PlaceEdges(); return; }
protected func Initialize() { // Spielziele setzen FindObject(CROB)->AddType(CST3, 1); FindObject(CROB)->AddType(TWR2, 2); FindObject(CROB)->AddType(HUT3, 6); FindObject(CROB)->SetMissionAccess("NewLand"); // Einzelne Hütte erzeugen CreateConstruction(HUT2, 1070, 330, -1, 100, 1); return 1; }
global func RemoveAll(id idDef, int dwOCF) { var Cnt, obj = FindObject(idDef, 0,0,0,0, dwOCF), next; while (obj) { // Get the next object in case obj->Destruction does funny things next = FindObject(idDef, 0,0,0,0, dwOCF, 0,0,0, obj); if(RemoveObject(obj)) ++Cnt; obj = next; } return(Cnt); }
static vlc_object_t * FindObject( vlc_object_t *p_this, int i_type, int i_mode ) { int i; vlc_object_t *p_tmp; switch( i_mode & 0x000f ) { case FIND_PARENT: p_tmp = p_this->p_parent; if( p_tmp ) { if( p_tmp->i_object_type == i_type ) { p_tmp->i_refcount++; return p_tmp; } else { return FindObject( p_tmp, i_type, i_mode ); } } break; case FIND_CHILD: for( i = p_this->i_children; i--; ) { p_tmp = p_this->pp_children[i]; if( p_tmp->i_object_type == i_type ) { p_tmp->i_refcount++; return p_tmp; } else if( p_tmp->i_children ) { p_tmp = FindObject( p_tmp, i_type, i_mode ); if( p_tmp ) { return p_tmp; } } } break; case FIND_ANYWHERE: /* Handled in vlc_object_find */ break; } return NULL; }
func ControlUseStart(object clonk, int ix, int iy) { // Auto-use on spin wheel var wheel = FindObject(Find_AtRect(-5,-5,10,10), Find_ID(SpinWheel)); if (!wheel) wheel = FindObject(Find_AtPoint(ix,iy), Find_ID(SpinWheel)); if (!wheel) { if (clonk->GetMenu()) clonk->CloseMenu(); else Dialogue->MessageBox("$KeyNoLock$", clonk, clonk, nil, true); } else wheel->CheckLock(clonk); // using on wheel return true; }
func InitializePlayer(int iPlr) { // Message positioning SetPlrShowControlPos(iPlr, SHOWCTRLPOS_TopLeft); SetTutorialMessagePos(MSG_Top | MSG_Left | MSG_WidthRel | MSG_XRel, 50, 50, 30); SetPlrShowControl(0,"___345678_ 345678 __________"); // Positionen speichern iBlnX = FindObject(BALN)->GetX(); iBlnY = FindObject(BALN)->GetY(); iPlrX = FindObject(CLNK)->GetX(); iPlrY = FindObject(CLNK)->GetY(); iCounter = 0; CreateMaterial(iPlr); }
func OnSale(int to_player, object sale_base) { // Inform goal of gem sale var goal = FindObject(Find_ID(Goal_SellGems)); if (goal) goal->OnGemSold(); return true; }
/** Extract liquid from this @param sznMaterial: Material to extract @param inMaxAmount: Max Amount of Material being extracted @param pnPump: Object which extracts the liquid @param pnPipe: Pipe which extracts the liquid (connected to pnPump) @param bnWildcard: Usefull to extract random liquids; use '*' for sznMaterial for all Materials @return [irMaterial,irAmount] -irMaterial: Material being extracted -irAmount: Amount being extracted */ public func LiquidOutput(string sznMaterial, int inMaxAmount, object pnPump, object pnPipe, bool bnWildcard) { //Search liquid to pump if (bnWildcard) { var ptBarrel = FindObject(Find_Container(this), Find_Func("IsBarrel"), Find_Func("IsBarrelForMaterial", sznMaterial), Find_Not(Find_Func("BarrelIsEmpty"))); var sztMaterial=""; if (ptBarrel) sztMaterial = ptBarrel->GetBarrelMaterial(); //Nothing to pump if (sztMaterial == "") return ["", 0]; sznMaterial = sztMaterial; } var itFound = 0; for (var ptBarrel in FindObjects(Find_Container(this), Find_Func("IsBarrel"), Find_Func("IsBarrelForMaterial", sznMaterial), Find_Not(Find_Func("BarrelIsEmpty")))) { var atFound = ptBarrel->GetLiquid(sznMaterial, inMaxAmount - itFound, this); //Crazy stuff happend? itFound += BoundBy(atFound[1], 0, inMaxAmount - itFound); if (itFound == inMaxAmount) break; } return [sznMaterial, itFound]; }
protected func Initialize() { // Alle Fische anfangs umfärben var pFish; while(pFish=FindObject(FISH,0,0,0,0,0,0,0,0,pFish)) Colorize(pFish); }
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; }
global func CreateBurnMark(int iX, int iY, int iLevel, int Count) { var boom; if(!ObjectCount(BOOM)) boom = CreateObject(BOOM,0,0,-1); else boom = FindObject(BOOM); var angle=Random(360/Count); //variablen für die überprüfung var type; for(var z; z < Count; z++) { angle += Max(1,360/Count); // Check: Sky or Solid/Liquid var x = iX+Cos(angle,iLevel); var y = iY+Sin(angle,iLevel); if((GetMaterialVal("Density","Material",GetMaterial(x,y)) != 0) || (GetMaterial(x,y) == -1)) continue; type = 1+Random(3); var size = BurnMarkCheck(angle,RandomX(iLevel/2,iLevel*2),iX,iY); var sin = Sin(angle,(size-iLevel)/2+iLevel+Random(3)); var cos = Cos(angle,(size-iLevel)/2+iLevel+Random(3)); CreateParticle("BurnMark",iX+cos,iY+sin,Cos(angle+RandomX(-5,5),50),Sin(angle+RandomX(-5,5),50),size*5+Random(25),RGBa(0,0,0,64),boom,1); } }
func QueryOnSell() { // Inform goal of gem sale var goal = FindObject(Find_ID(Goal_SellGems)); if (goal) goal->OnGemSold(); return false; // do perform selling }
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; }
bool MENU_Base::ObjectExists( MENU_BaseObject* pObject ) { if (FindObject(pObject) >= 0) return true; else return false; }
func Initialize() { // Goal var goal = FindObject(Find_ID(Goal_RepairStatue)); if (!goal) goal = CreateObject(Goal_RepairStatue); var statue = CreateObject(MinersStatue, 600,736); statue->SetBroken(); var statue_head = CreateObject(MinersStatue_Head, 2200,560); goal->SetStatue(statue); // Rules if (!ObjectCount(Find_ID(Rule_TeamAccount))) CreateObject(Rule_TeamAccount); if (!ObjectCount(Find_ID(Rule_BuyAtFlagpole))) CreateObject(Rule_BuyAtFlagpole); // Mushrooms before any earth materials, because they create their own caves LargeCaveMushroom->Place(15, Rectangle(100,0,600,300)); // Create earth materials // Create them in big clusters so the whole object arrangement looks a bit less uniform and more interesting PlaceBatches([Firestone], 5, 100, 10); PlaceBatches([Rock, Loam, Loam], 10, 200, 10); // Misc vegetation SproutBerryBush->Place(5, Rectangle(100,0,600,300)); Mushroom->Place(5, Rectangle(100,0,600,300)); // Sky SetSkyParallax(1, 20,20, 0,0, nil, nil); return true; }
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 CDVBSub::Render(SubPicDesc& spd, REFERENCE_TIME rt, RECT& bbox) { DVB_PAGE* pPage = FindPage(rt); if (pPage != NULL) { pPage->Rendered = true; for (int i = 0; i < pPage->RegionCount; i++) { CDVBSub::DVB_REGION* pRegion = &pPage->Regions[i]; for (int j = 0; j < pRegion->ObjectCount; j++) { CompositionObject* pObject = FindObject(pPage, pRegion->Objects[j].object_id); if (pObject) { short nX, nY; nX = pRegion->HorizAddr + pRegion->Objects[j].object_horizontal_position; nY = pRegion->VertAddr + pRegion->Objects[j].object_vertical_position; pObject->m_width = pRegion->width; pObject->m_height = pRegion->height; pObject->SetPalette(pRegion->Clut.Size, pRegion->Clut.Palette, m_Display.width > 720); pObject->RenderDvb(spd, nX, nY); } } } bbox.left = 0; bbox.top = 0; bbox.right = m_Display.width; bbox.bottom = m_Display.height; } }
func Initialize() { if (FindObject(Find_ID(Rule_StructureHPBars))) if (this.HitPoints != nil) AddEnergyBar(); return _inherited(...); }
wxTreeItemId PanelObjectList::FindObject(wxTreeCtrl* tree, void* pObject, wxTreeItemId idroot) { wxTreeItemIdValue cookie; wxTreeItemId id = tree->GetFirstChild( idroot, cookie ); while( id.IsOk() ) { wxTreeItemData* pData = tree->GetItemData( id ); if( pData ) { void* objptr = ((TreeItemDataGenericObjectInfo*)pData)->m_pObject; if( objptr == pObject ) { return id; } } if( tree->ItemHasChildren( id ) ) { id = FindObject( tree, pObject, id ); if( id.IsOk() ) return id; } id = tree->GetNextChild( idroot, cookie ); } return wxTreeItemId(); }
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); }