public void ClearSlot() { TowerImage.sprite = null; FruitData = null; TowerImage.enabled = false; CountText.enabled = false; }
string GetFruitName(FruitData fruitData) { TextColor textColor = TextColor.white; switch (fruitData.FruitLevel) { case 0: textColor = TextColor.EquipmentGreen; break; case 1: textColor = TextColor.EquipmentBlue; break; case 2: textColor = TextColor.EquipmentMagenta; break; case 3: textColor = TextColor.EquipmentYellow; break; default: break; } string name = NGUIColor.SetTxtColor(LanguageTextManager.GetString(fruitData.FruitName), textColor); return(name); }
public void UnSelectObject() { FruitData = null; ObjectSpriteRenderer.sprite = null; ObjectSpriteRenderer.enabled = false; SquareSpriteRenderer.enabled = false; }
void OnUseManaFromServer(object obj) { SMsgActionUseManna_SC sMsgActionUseManna_SC = (SMsgActionUseManna_SC)obj; FruitData fruitData = TreasureTreesDataBase.FruitDataList.FirstOrDefault(P => P.FruitID == sMsgActionUseManna_SC.dwFruitID); FruitLogMessageWindow.AddUserAmritaLogInfoFromServer(fruitData); }
public void OccupySlot(FruitData p_FruitData) { FruitData = p_FruitData; SetTowerImage(p_FruitData.Sprite); TowerImage.enabled = true; AlterTowerCount(+1); }
public void AddItem(FruitData p_FruitData) { if (p_FruitData.CostPerSeason[SeasonController.Instance.SeasonIterator] > MoneyManager.Instance.MoneyCount) { return; } for (int i = 0; i < InventorySlots.Count; i++) //Already have that item { if (InventorySlots[i].GetFruitData() == null) { continue; } if (InventorySlots[i].GetFruitData().Name == p_FruitData.Name) { InventorySlots[i].AlterTowerCount(+1); return; } } for (int i = 0; i < InventorySlots.Count; i++) //Empty Slot { if (InventorySlots[i].GetFruitData() == null) { InventorySlots[i].OccupySlot(p_FruitData); return; } } }
void OnGetRewardFromServer(object obj) { SMsgActionChooseFruit_SC sMsgActionChooseFruit_SC = (SMsgActionChooseFruit_SC)obj; FruitData fruitData = TreasureTreesDataBase.FruitDataList.FirstOrDefault(P => P.FruitID == sMsgActionChooseFruit_SC.dwFruitID); FruitLogMessageWindow.AddGetFruitLogInfoServer(fruitData, (int)sMsgActionChooseFruit_SC.dwGoodsID, (int)sMsgActionChooseFruit_SC.dwGoodsNum); GetAwardAnimManager.PickUpFruit(sMsgActionChooseFruit_SC.byFruitPosition, (int)sMsgActionChooseFruit_SC.dwGoodsID, (int)sMsgActionChooseFruit_SC.dwGoodsNum); }
public void AddGetFruitLogInfoServer(FruitData data, int itemId, int itemCount) { ItemData itemData = ItemDataManager.Instance.GetItemData(itemId); string itemName = LanguageTextManager.GetString(itemData._szGoodsName); string LogMsg = string.Format(LanguageTextManager.GetString("IDS_I28_5"), GetCurrentTime(), GetFruitName(data), itemName, itemCount); AddStringToMsg(LogMsg); }
public void SetFruitData(FruitData p_Fruitdata) { FruitData = p_Fruitdata; SR.sprite = FruitData.Sprite; SlapperDown = FruitData.SlapperDown; if (FruitData.SeasonStrength[SeasonController.Instance.SeasonIterator]) { SlapRate = FruitData.FireRate / FruitData.SeasonStrengthMultiplier; } else { SlapRate = FruitData.FireRate; } }
public void SetFruitData(FruitData p_Fruitdata) { FruitData = p_Fruitdata; SR.sprite = FruitData.Sprite; if (FruitData.SeasonStrength[SeasonController.Instance.SeasonIterator]) { FireRate = FruitData.FireRate / FruitData.SeasonStrengthMultiplier; } else { FireRate = FruitData.FireRate; } Shot = FruitData.Shot; }
public bool ItemRemaining(FruitData p_FruitData) { for (int i = 0; i < InventorySlots.Count; i++) { if (InventorySlots[i].GetFruitData() == null) { continue; } if (InventorySlots[i].GetFruitData().Name == p_FruitData.Name) { return(true); } } return(false); }
public void RemoveItem(FruitData p_FruitData) { for (int i = 0; i < InventorySlots.Count; i++) //Already have that item { if (InventorySlots[i].GetFruitData() == null) { continue; } if (InventorySlots[i].GetFruitData().Name == p_FruitData.Name) { InventorySlots[i].AlterTowerCount(-1); return; } } }
public void SetFruitData(FruitData p_Fruitdata) { FruitData = p_Fruitdata; if (FruitData.SeasonStrength[SeasonController.Instance.SeasonIterator]) { Collider.radius = FruitData.BombRadius * FruitData.SeasonStrengthMultiplier; } else { Collider.radius = FruitData.BombRadius; } SR.sprite = FruitData.Sprite; FuseTimer = FruitData.BombFuseTimer; Damage = FruitData.BombExplosionDamage; }
private static void PostProcessorFruitData() { string path = System.IO.Path.Combine(RESOURCE_TREASURETREES_CONFIG_FOLDER, "PlayerFruit.xml"); TextReader tr = new StreamReader(path); string text = tr.ReadToEnd(); if (text == null) { Debug.LogError("Player level config file not exist"); return; } else { XmlSpreadSheetReader.ReadSheet(text); XmlSpreadSheet sheet = XmlSpreadSheetReader.Output; string[] keys = XmlSpreadSheetReader.Keys; object[] levelIds = sheet[keys[0]]; List <FruitData> tempList = new List <FruitData>(); for (int i = 0; i < levelIds.Length; i++) { if (0 == i || 1 == i) { continue; } FruitData data = new FruitData(); data.FruitID = Convert.ToInt32(sheet["FruitID"][i]); data.FruitName = Convert.ToString(sheet["FruitName"][i]); data.SeedModelID = Convert.ToString(sheet["SeedModelID"][i]); data.FlowerModelID = Convert.ToString(sheet["FlowerModelID"][i]); data.GrowModelID = Convert.ToString(sheet["GrowModelID"][i]); data.RipenModelID = Convert.ToString(sheet["RipenModelID"][i]); data.FruitLevel = Convert.ToInt32(sheet["FruitLevel"][i]); data.FlowerTime = Convert.ToInt32(sheet["FlowerTime"][i]); data.GrowTime = Convert.ToInt32(sheet["GrowTime"][i]); data.RipenTime = Convert.ToInt32(sheet["RipenTime"][i]); data.RewardType = Convert.ToInt32(sheet["RewardType"][i]); data.RewardNumber = Convert.ToString(sheet["RewardNumber"][i]); data.FruitReward = Convert.ToString(sheet["FruitReward"][i]).Split('+'); tempList.Add(data); } CreateConfigDataBase(tempList); } }
public void SelectObject(FruitData p_FruitData) { if (p_FruitData != null) { FruitData = p_FruitData; ObjectSpriteRenderer.sprite = p_FruitData.Sprite; ObjectSpriteRenderer.enabled = true; if (p_FruitData.Type != TowerType.BOMB) { SquareSpriteRenderer.enabled = true; } else { SquareSpriteRenderer.enabled = false; } State = PlacementObjectState.SELECTED; } }
///////////////////////////////////////////////////////////////////////////////////////////////////// #region OBJECT ///////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Initializes an instance of the <c>MainControl</c> class. /// </summary> public MainControl() { InitializeComponent(); FruitData.Add(new Fruit("Apple", "Red", 52)); FruitData.Add(new Fruit("Avocado", "Green", 160)); FruitData.Add(new Fruit("Strawberry", "Red", 46)); FruitData.Add(new Fruit("Grape", "Green", 114)); FruitData.Add(new Fruit("Watermelon", "Red", 92)); FruitData.Add(new Fruit("Banana", "Yellow", 94)); FruitData.Add(new Fruit("Pineapple", "Yellow", 76)); FruitData.Add(new Fruit("Orange", "Orange", 86)); FruitData.Add(new Fruit("Grapefruit", "Orange", 82)); FruitData.Add(new Fruit("Lemon", "Yellow", 17)); FruitData.Add(new Fruit("Lime", "Green", 16)); FruitData.Add(new Fruit("Pear", "Green", 98)); FruitData.Add(new Fruit("Plum", "Purple", 36)); GroupByFirstLetter = (a, b) => ((string)a)[0].Equals(((string)b)[0]); LabelWithFirstLetter = a => ((string)a).Substring(0, 1); SortAlphabetically = (a, b) => ((string)a).ToLower()[0] - ((string)b).ToLower()[0]; }
void itemInit() { _hero.iBood = 5; _hero.iMoveSpeed = 210f; _data.jqName = "level1JQ"; FruitData fd = new FruitData(); fd.name = "order1"; fd.interval = 0.4f; fd.minGet = 7; FruitItem fi = new FruitItem(); fi.name = "fruit1"; fi.weight = 1; fi.speed = 100; for(int i = 0; i < 11; ++i) fd.fruits.Add(fi); _data.fruit = fd; EnemyData ed = new EnemyData(); ed.iBoold = 8; ed.moveSpeed = 160; ed.interval = 1f; ed.iBulCount = 12; for (int i = 0; i < ed.iBulCount; ++i) { BulletItem bd = new BulletItem(); int range = Random.Range(0, 2); bd.bCanRebound = range == 0 ? false : true; bd.weight = 1; bd.speed = 100; ed.bullets.Add(bd); } _data.enemy = ed; }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { NintendoLand.TileTypes.Bee bee = tileType as NintendoLand.TileTypes.Bee; return(new Bee() { index = bee.index }); }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { return(new Start()); }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { NintendoLand.TileTypes.Hole hole = tileType as NintendoLand.TileTypes.Hole; return(new Hole() { state = (Size)stage.holeDefinitions[hole.definitionIndex] }); }
public void UpdateFruitPointStatus() { MyFruitData = TreasureTreesData.Instance.FruitDataList.FirstOrDefault(P => P.byFruitPosition == MyPositionID); //TraceUtil.Log("下发果实ID:" + MyFruitData.dwFruitID + ",MyPositionID:" + MyPositionID); MyLocalFruitData = myParent.TreasureTreesDataBase.FruitDataList.FirstOrDefault(P => P.FruitID == MyFruitData.dwFruitID); ResetFruitPointStatus(); if (MyFruitData.dwFruitID != 0) { //TraceUtil.Log("刷新果实状态,是否干旱:"+MyFruitData.byFruitDryStatus+",是否成熟:"+MyFruitData.byFruitStatus); LockICon.SetActive(false); CreatFlashEffectPoint.ClearChild(); ShowFruitIcon(); if (!ShowIsDroughtStatus()) { //TraceUtil.Log("果实状态:" + MyFruitData.byFruitStatus+",是否干旱:"+MyFruitData.byFruitDryStatus); switch ((FruitPrucStatusType)MyFruitData.byFruitStatus) { case FruitPrucStatusType.NONE_FRUIT_STATUS_TYPE: break; case FruitPrucStatusType.SEED_FRUIT_STATUS_TYPE: FruitIcon.spriteName = MyLocalFruitData.SeedModelID; ShwoGrowingStates(); break; case FruitPrucStatusType.FLOWER_FRUIT_STATUS_TYPE: FruitIcon.spriteName = MyLocalFruitData.FlowerModelID; ShwoGrowingStates(); break; case FruitPrucStatusType.GROW_FRUIT_STATUS_TYPE: FruitIcon.spriteName = MyLocalFruitData.GrowModelID; ShwoGrowingStates(); break; case FruitPrucStatusType.RIPEN_FRUIT_STATUS_TYPE: FruitIcon.spriteName = MyLocalFruitData.RipenModelID; ShowCantPickStatus(); break; } } } else { //锁住状态 LockICon.SetActive(true); int UnlockLevel = myParent.TreasureTreesDataBase.TreasureTreesDataList.First(P => P.PositionID == MyPositionID).UnlockLevel; if (UnlockLevel > 0) { FruitTitle.SetText(string.Format(LanguageTextManager.GetString("IDS_H1_462"), UnlockLevel)); OpenWithHC.SetActive(false); } else { FruitTitle.SetText(""); OpenWithHC.SetActive(true); } } }
public void SelectPlacementObject(FruitData p_FruitData) { PlacementObject.SelectObject(p_FruitData); }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { NintendoLand.TileTypes.Spike spike = tileType as NintendoLand.TileTypes.Spike; return(new Spike() { state = (SpikeStartState)spike.state }); }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { NintendoLand.TileTypes.Fruit fruit = tileType as NintendoLand.TileTypes.Fruit; var fruitMappings = stage.fruitAssociations[fruit.index - 1].Values; var fruitTypeMappings = fruitMappings.Select(fruitMapping => fruitData.FruitByID[fruitMapping].FruitType); var fruitTypes = new HashSet <FruitData.FruitType>(fruitTypeMappings.SelectMany(mapping => mapping.Values).Select(entry => (FruitData.FruitType)entry)); return(new Fruit() { selectedFruitTypes = ((FruitData.FruitType[])Enum.GetValues(typeof(FruitData.FruitType))).ToDictionary( enumValue => enumValue, enumValue => fruitTypes.Contains(enumValue)) }); }
public abstract BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData);
public void AddUserAmritaLogInfoFromServer(FruitData data) { string LogMsg = string.Format(LanguageTextManager.GetString("IDS_H1_458"), GetCurrentTime(), GetFruitName(data)); AddStringToMsg(LogMsg); }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { NintendoLand.TileTypes.Goal goal = tileType as NintendoLand.TileTypes.Goal; return(new Goal() { levelTarget = goal.levelTarget, bonusGoalInput = new TextBox() }); }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { NintendoLand.TileTypes.OrderedFruit orderedFruit = tileType as NintendoLand.TileTypes.OrderedFruit; var orderedFruitMappings = stage.orderedFruitDefinition[orderedFruit.order - 1].Values; var orderedFruitTypeMappings = orderedFruitMappings.Select(fruitMapping => fruitData.FruitByID[fruitMapping].FruitType); var orderedFruits = new HashSet <FruitData.FruitType>(orderedFruitTypeMappings.SelectMany(mapping => mapping.Values).Select(entry => (FruitData.FruitType)entry)); return(new OrderedFruit() { order = orderedFruit.order, selectedFruitTypes = ((FruitData.FruitType[])Enum.GetValues(typeof(FruitData.FruitType))).ToDictionary( enumValue => enumValue, enumValue => orderedFruits.Contains(enumValue)) }); }
public override BaseObject FromTileType(BaseType tileType, StageData.Stage stage, FruitData fruitData) { NintendoLand.TileTypes.RotatingObject rotatingObject = tileType as NintendoLand.TileTypes.RotatingObject; return(new RotatingObject() { index = rotatingObject.index, orbitters = new List <BaseObject>(), pivotInput = new ComboBox() }); }