public void Teleport(HexSprite m) { this.pos = m; this.rut = new List <Hex>() { }; this.rut.Insert(0, HexGenerator.O); }
public static void Init(HexSprite p) { playable = new Party(CharacterManager.FACTION.player, p); nonPlayer = new List <Party>() { }; Hex2Char = new Dictionary <HexSprite, Character>() { }; }
public Party(CharacterManager.FACTION f, HexSprite p, MODE m = MODE.physical) { this.faction = f; CharacterManager.GenParty(this); this.pos = p; this.mode = m; this.members = new List <Character>() { }; this.rut = new List <Hex>() { }; }
public void Move(Hex m) { this.pos += m; if (this.formUpTurn == 0) { this.rut.RemoveAt(this.rut.Count - 1); } for (int i = 0; i < this.rut.Count; i++) { this.rut[i] -= m; } this.rut.Insert(0, HexGenerator.O); }
private void HexGrid_HexEntered(HexSprite enteredSprite) { // if dragging a ship, see if we're entering a hex that ship can be put into or not if (_draggingAccordion != null) { if (!_draggingAccordion.Fleet.DeploymentHexes.Contains(_mapData.GetMapNode(enteredSprite.GridPosition.x, enteredSprite.GridPosition.y))) { //Cursor.SetCursor(_disabledCursorTexture, new Vector2(0.5f, 0.5f), CursorMode.Auto); } else { Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); } } }
public Dictionary <HexSprite, (int, List <HexUnit>, HexSprite)> GetMinPaths( HexSprite s, int moveRange ) { Dictionary <HexSprite, (int, List <HexUnit>, HexSprite)> minCostPath = new Dictionary <HexSprite, (int, List <HexUnit>, HexSprite)>() { }; minCostPath[s] = (0, new List <HexUnit>() { }, null); FlatSightRecurcive( s, moveRange, minCostPath, FlatSight(s, s, moveRange, minCostPath) ); return(minCostPath); }
public void RecurciveMove() { if (targetList.Count == 0) { StopWalk(); Begin(); this.p = null; this.targetList = null; if (!(trapPrepared is null)) { trapPrepared.SetActive(true); // TODO: trap process // ex. status.MOV.c -= 1; trapPrepared = null; } return; } ; pos += targetList[0]; startP = endP; if (valMax) { endP = startP - map.GetMoveCost(pos); } else { endP = startP - diffP; } Vector3 v = map.HexUnit2World(targetList[0]); target += v; if (v.x > 0) { turnRight(); } if (v.x < 0) { turnLeft(); } targetList.RemoveAt(0); }
public bool ModeS2P(int controllMemderId) { this.rut.RemoveRange(0, this.rut.Count); this.rut.Add(HexGenerator.O); foreach (Character m in this.members) { if (m.posParty == controllMemderId) { m.isPReader = true; this.pos += m.posRel; m.posRel = HexGenerator.O; } else { m.HideFromMap(); m.isPReader = false; } } SetMode(MODE.physical); // BGM変更 return(true); }
public bool hasWall(HexSprite h) { return(til.GetTileNameGroundWall() == GetTileName(layerGround, h)); }
public bool hasGround(HexSprite h) { return(!isNull(layerGround, h)); }
public static bool isNull(Tilemap tm, HexSprite h) { return(tm.GetTile((Vector3Int)h) is null); }
public static string GetTileName(Tilemap tm, HexSprite h) { return(GetTileName(tm.GetTile((Vector3Int)h))); }
public void FlatSightRecurcive( HexSprite s, int moveRange, Dictionary <HexSprite, (int, List <HexUnit>, HexSprite)> minCostPath,
public int GetMoveCost(HexSprite h) { return(Hex2MoveCost[h] + (CharacterManager.Hex2Char.ContainsKey(h) ? MOVECOST_EXIST_CHARACTER : 0)); }
private void HexGrid_HexExited(HexSprite exitedSprite) { Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); }
public bool hasOnGround(HexSprite h) { // trap, wall or something. return(!isNull(layerOnGround, h)); }
public string GetGroundTileName(HexSprite h) { return(GetTileName(layerGround, h)); }