public void ShowStats() { Console.WriteLine(Name); Console.WriteLine("Lvl " + Lvl.ToString()); Console.WriteLine("HP " + CurrentHP.ToString()); Console.WriteLine("Damage " + Damage.ToString()); Console.WriteLine("Type " + Type.ToString()); Console.WriteLine(); }
private void Start() { if (gameObject.tag == "Breakable") { lvl = FindObjectOfType <Lvl>(); lvl.CountBreakableBlocks(); } gameStatus = FindObjectOfType <GameStatus>(); }
public void SetupSettings(Lvl lvl) { if (!gamePlaceRectTransform) { gamePlaceRectTransform = GetComponent <RectTransform>(); } Rect rect = gamePlaceRectTransform.rect; cellGrid.lengthWidthHeight = new Vector2(rect.width, rect.height); cellGrid.numberOfColumnsRowsLayers = new Vector3Int(lvl.numberOfColumnsAndRows.x, lvl.numberOfColumnsAndRows.y, 1); }
public void ChangeTilesImage(List <Tile> tiles, Lvl lvl) { var newSprites = SpriteEditor.CutTheSprite(lvl.texture2D, lvl.numberOfColumnsAndRows); foreach (var tile in tiles) { var position = ((TileFor15)tile).trueCell.positionInOddrCoordinates; var number = cellGrid.OddrCoordinatesInIndex(new Vector3Int(position.x, position.y, position.z)); tile.GetComponent <Image>().sprite = newSprites[number]; } }
public void ChangeTiles(List <Tile> tiles, Lvl lvl) { if (lvl.gameMode == Lvl.GameMode.TextAndImage || lvl.gameMode == Lvl.GameMode.Text) { ChangeTilesText(tiles); } if (lvl.gameMode == Lvl.GameMode.TextAndImage || lvl.gameMode == Lvl.GameMode.Image) { ChangeTilesImage(tiles, LvlManager.Instance.lvl); } }
public override void update() { Class.update(); Lvl.update(); Exp.update(); Hp.update(); Slash.update(); MaxHp.update(); Affinity_Icon.update(); foreach (Icon_Sprite icon in Status_Icons) { icon.update(); } }
public void StartLoading(Lvl level, bool reloadLevel = true) { currentLevel = level; enemiesManager.SetLevel(currentLevel); round.Play(((int)currentLevel + 1)); if (reloadLevel) { var levelScene = GD.Load <PackedScene>(string.Format("res://Resources/Levels/{0}", levels[currentLevel])); levelInstance = (Node2D)levelScene.Instance(); levelInstance.Position = scene.GetNode <Node2D>("LevelSpawnPoint").Position; scene.GetNode("LevelRoot").AddChild(levelInstance); } }
void OnLvlLoaded(Lvl _, int index) { numberOfLvlScore = 0; currentLvlIndex = index; var highScore = currentLvlIndex >= allScores.scoreList.Count ? 10 : allScores.scoreList[currentLvlIndex]; OnLoadScore.Invoke(currentLvlIndex, highScore); if (allScores.scoreList.Count >= currentLvlIndex + 1) { OnBestScoreLoaded.Invoke(allScores.scoreList[currentLvlIndex]); } else { OnBestScoreLoaded.Invoke(1000); } }
public override void draw(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2)) { Vector2 loc = this.loc + draw_vector(); sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, Scissor_State); Class.draw(sprite_batch, draw_offset - loc); Lvl.draw(sprite_batch, draw_offset - loc); Exp.draw(sprite_batch, draw_offset - loc); Hp.draw(sprite_batch, draw_offset - loc); Slash.draw(sprite_batch, draw_offset - loc); MaxHp.draw(sprite_batch, draw_offset - loc); Affinity_Icon.draw(sprite_batch, draw_offset - loc); foreach (Status_Icon_Sprite icon in Status_Icons) { icon.draw(sprite_batch, draw_offset - loc); } sprite_batch.End(); }
public string FormatOutput() { //code below is for monster var myReturn = Name; myReturn += " , Level : " + Lvl.ToString(); myReturn += " , Total Experience : " + ExperienceTotal; myReturn += " , Attack : " + Atk; myReturn += " , Defense : " + Def; myReturn += " , Speed : " + Spd; myReturn += " , Type: " + Type; myReturn += " , MoveingRange: " + MoveRange; myReturn += " , AttackRange: " + AtkRange; return(myReturn); }
// Helper to combine the attributes into a single line, to make it easier to display the item as a string public string FormatOutput() { var myReturn = string.Empty; myReturn += Name; myReturn += " , Level : " + Lvl.ToString(); myReturn += " , Total Experience : " + CurrentExp; myReturn += " , Attack : " + Atk; myReturn += " , Defense : " + Def; myReturn += " , Speed : " + Spd; myReturn += " , Type: " + Type; myReturn += " , MoveingRange: " + MoveRange; myReturn += " , AttackRange: " + AtkRange; //Item section comes here myReturn += " , Items : " + EquippedItemListString; myReturn += ", Damage : " + totalDamage; return(myReturn); }
private void PlaceTO() { Debug.Log("PlaceTO - .tileObjectPrefab: " + Lvl.tileObjectPrefab + ", .typ: " + Lvl.tileObjectPrefab.GetType()); Undo.RegisterFullObjectHierarchyUndo(Lvl, "Placed TileObject"); Vec2i tilePos = GameHelper.WorldToTilePos(GetMouseWorldPos() - (Vector2)Lvl.transform.position); if (!Lvl.Map.HasTOTypeAtPos(tilePos, Lvl.tileObjectPrefab.GetType())) //if tile not already contains type { string className = Lvl.tileObjectPrefab.GetType().FullName + ", " + Lvl.tileObjectPrefab.GetType().Assembly.GetName().Name; //Lvl.tileObjectPrefab.ToDef //TileObjectDefintion toDef = new TileObjectDefintion { pos = tilePos, className = className }; Debug.Log("PlacedTO - Lvl.tileObjectDefinition: " + Lvl.tileObjectDefinition + ", typ: " + Lvl.tileObjectDefinition.GetType()); Lvl.tileObjectDefinition.pos = tilePos; Lvl.tileObjectDefinition.className = className; TileObject to = Lvl.CreateTOAtPos(Lvl.tileObjectPrefab, Lvl.tileObjectDefinition); Undo.RegisterCreatedObjectUndo(to.gameObject, "Create TileObject"); } current.Use(); }
public void EnterWorld(int mapID) { Lvl = GameObject.FindObjectOfType <LevelSystem>(); if (Lvl == null) { GameObject go = new GameObject("LevelSystem"); Lvl = go.AddComponent <LevelSystem>(); } else { Lvl.DelAllElements(); } CharacterManager.Instance.SetRoot(Lvl.transform); Ect = new EffectSystem(); Fly = new FlywordSystem(); Hud = new HUDSystem(); Act = new ActSystem(); Nts = new NodeTreeSystem(); Plt = new PlotSystem(); Cut = new VideoSystem(); Lvl.Id = mapID; Lvl.Startup(); }
void UpdateCurrentTargetScore(Lvl currentLvl, int _) { this.currentTargetScore = currentLvl.targetOfShoots; }
void OnLvlLoaded(Lvl level, int _) { textMeshProUGUI.text = level.targetOfShoots.ToString(); }
void ClearScore(Lvl _, int __) { textMeshProUGUI.text = "0"; }