public ReqModify ModifyShip(UserShip ship) { ReqModify component = new ReqModify(); component.ModifyShip(ship); return(component); }
private void button1_Click(object sender, EventArgs e) { PVECampaignLevel lv = PVEConfigs.instance.GetCampaignLevel(cur_lvid); if (lv == null) { MessageBox.Show("先选择关卡"); return; } int i = 0; int[] campships = GameData.instance.GetCampaignFleetInfo(lv.id); if (campships == null || campships.Sum() == 0) { MessageBox.Show("请选择舰队..."); return; } var camp = GameData.instance.GetCampaignInfo(lv.campaignId); var totalcamp = GameData.instance.TotalCampainInfo; if (camp.remainNum == 0) { MessageBox.Show("本日次数已经耗光"); return; } CurrentWarParameters.selectedCampaignLevel = lv; List <UserShip> shiptosupply = new List <UserShip>(); foreach (int stoi in campships) { UserShip us = GameData.instance.GetShipById(stoi); if (us != null) { shiptosupply.Add(us); } } ServerRequestManager.instance.SupplyMulti(shiptosupply); MessageBox.Show("战役少女吃喝完毕,稍等后点击确认继续...."); var rs = ServerRequestManager.instance.SearchCampaign(lv.id); if (rs != null && rs.responseData != null && rs.responseData.eid == 0) { MessageBox.Show("索敌中,稍等继续...."); var r = ServerRequestManager.instance.StartCampaignWar(lv.id, formationcombo.SelectedIndex + 1); if (r != null && r.responseData != null && r.responseData.eid == 0) { MessageBox.Show("请等待足够战斗时间再点确认...."); var ret = ServerRequestManager.instance.GetCampaignWarResult(checkBoxX1.Checked); if (r != null && r.responseData != null && r.responseData.eid == 0) { MessageBox.Show(tools.helper.getCampwarresultstring(ret.responseData as GetCampaignWarResultResponse)); } updateCampFleet(lv.id); } } }
public ReqSkill SkillShip(UserShip ship) { ReqSkill component = new ReqSkill(); component.SkillShip(ship); return(component); }
internal void tryaddtodis(int rowindex, int shipcid) { GridPanel p = nondislist.PrimaryGrid; int cid = (int)p.GetCell(rowindex, 5).Value; ShipConfig sc = AllShipConfigs.instance.getShip(cid); if (cid == shipcid) { object[] vals = new object[6]; UserShip us = new UserShip(); us.shipCid = sc.cid; us.level = 1; us.battleProps = new ShipBattleProps(); us.battlePropsMax = new ShipBattleProps(); us.battleProps.hp = sc.hp; us.battlePropsMax.hp = sc.hpMax; vals[0] = p.GetCell(rowindex, 1).Value; vals[1] = p.GetCell(rowindex, 2).Value; vals[2] = p.GetCell(rowindex, 3).Value; vals[3] = tools.helper.getShipSmallImage(us); vals[4] = "移除"; vals[5] = cid; GridRow gr = new GridRow(vals); dislist.PrimaryGrid.Rows.Add(gr); gr.RowHeight = 30; p.Rows.Remove(p.Rows[rowindex]); } //var sc = AllShipConfigs.instance.getShip(cid); tools.configmng.instance.adddisship(cid, tools.helper.getstartstring(sc.star) + " " + sc.title); //EditorCell.GridRow.Cells[1].CellStyles.Default.Background = new DevComponents.DotNetBar.SuperGrid.Style.Background(s == "吃掉" ? Color.White : Color.LightGreen); }
public ReqEquipment ChangeEquip(UserShip ship, int position, int newEquipId) { ReqEquipment component = new ReqEquipment(); component.ChangeEquip(ship, position, newEquipId); return(component); }
internal void updateCurFleetInfo() { foreach (ButtonX b in ships) { b.Image = null; b.Location = new Point(12, b.Location.Y); b.Visible = false; } int i = 0; foreach (var uf in GameData.instance.UserFleets) { i++; if (uf.ships == null || uf.ships.Length == 0 || GameData.instance.IsFleetInRepair(uf.id) || GameData.instance.IsFleetInExplore(uf.id) ) { continue; } UserShip us = GameData.instance.GetShipById(uf.ships[0]); if (us != null) { ships[i - 1].Visible = true; ships[i - 1].Image = tools.helper.getShipSmallImage(us); } } }
public ReqEquipment DeleteEquip(UserShip ship, int position) { ReqEquipment component = new ReqEquipment(); component.DeleteEquip(ship, position); return(component); }
internal void updateCurFleetInfo() { UserFleet uf = GameData.instance.GetFleetOfId(FleetID); if (uf == null) { return; } Text = "查看少女 -- " + uf.title; int i = 0; if (shipid > 0) { UserShip us = GameData.instance.GetShipById(shipid); updateshipinfo(us); updateprop(us); lockallweapon(us); updateweapon(us); } else { biglihui.BackgroundImage = tools.helper.OpenImage("res/png/unknown/899.png"); updateshipinfo(null); lockallweapon(null); updateprop(null); } }
private void updateweapon(UserShip us) { for (int i = 0; i < 4; i++) { updateoneweapon(us, i); } }
public static GridRow getonerow(UserShip us) { object[] vals = new object[19]; vals[0] = us.fleetId > 0 ? (GameData.instance.UserFleets[us.fleetId - 1].title) : ""; vals[1] = us.level; vals[2] = us.ship.title; vals[3] = tools.helper.getshiptype(us.ship.type); vals[4] = tools.helper.getShipSmallImage(us); vals[5] = 100 * us.battleProps.hp / us.battlePropsMax.hp; vals[6] = us.battleProps.def; // +"/" + us.battlePropsMax.def; vals[7] = us.battleProps.atk; // + "/" + us.battlePropsMax.atk; vals[8] = us.battleProps.torpedo; // + "/" + us.battlePropsMax.torpedo; vals[9] = us.battleProps.airDef; // + "/" + us.battlePropsMax.airDef; vals[10] = us.battleProps.antisub; // + "/" + us.battlePropsMax.antisub; vals[11] = us.battleProps.radar; // + "/" + us.battlePropsMax.radar; vals[12] = us.battleProps.speed; // + "/" + us.battlePropsMax.def; vals[13] = us.battleProps.luck; // + "/" + us.battlePropsMax.def; vals[14] = +us.battleProps.miss; // + "/" + us.battlePropsMax.miss; vals[15] = us.love + "/" + us.loveMax; vals[16] = "选择"; vals[17] = us.IsLocked ? "解锁" : "锁定"; vals[18] = us.id; GridRow gr = new GridRow(vals); gr.RowHeight = 30; return(gr); }
void CheckStateChangedCallback(object sender, EventArgs e) { int shipid = (int)EditorCell.GridRow.Cells[5].Value; string s = (string)EditorCell.GridRow.Cells[0].Value; if (s == "吃掉") { if (form.getselcount() >= 10) { MessageBox.Show("一次最多10只少女..."); return; } EditorCell.GridRow.Cells[0].Value = "不吃"; } else { EditorCell.GridRow.Cells[0].Value = "吃掉"; } UserShip us = GameData.instance.GetShipById(shipid); if (us == null) { MessageBox.Show("错误的船只信息"); return; } form.updateCheckList(us); EditorCell.GridRow.Cells[1].CellStyles.Default.Background = new DevComponents.DotNetBar.SuperGrid.Style.Background(s == "吃掉"? Color.White:Color.LightGreen); }
public static GridRow getonerow(UserShip us) { object[] vals = new object[19]; vals[0] = us.fleetId > 0 ? (GameData.instance.UserFleets[us.fleetId - 1].title) : ""; vals[1] = us.level; vals[2] = us.ship.title; vals[3] = tools.helper.getshiptype(us.ship.type); vals[4] = tools.helper.getShipSmallImage(us); vals[5] = 100 * us.battleProps.hp / us.battlePropsMax.hp; vals[6] = us.battleProps.def;// +"/" + us.battlePropsMax.def; vals[7] = us.battleProps.atk;// + "/" + us.battlePropsMax.atk; vals[8] = us.battleProps.torpedo;// + "/" + us.battlePropsMax.torpedo; vals[9] = us.battleProps.airDef;// + "/" + us.battlePropsMax.airDef; vals[10] = us.battleProps.antisub;// + "/" + us.battlePropsMax.antisub; vals[11] = us.battleProps.radar;// + "/" + us.battlePropsMax.radar; vals[12] = us.battleProps.speed;// + "/" + us.battlePropsMax.def; vals[13] = us.battleProps.luck;// + "/" + us.battlePropsMax.def; vals[14] = +us.battleProps.miss;// + "/" + us.battlePropsMax.miss; vals[15] = us.love + "/" + us.loveMax; vals[16] = "选择"; vals[17] = us.IsLocked ? "解锁" : "锁定"; vals[18] = us.id; GridRow gr = new GridRow(vals); gr.RowHeight = 30; return gr; }
private static void do_reportGotShip(GetBattleResultResponse battleResult, int battle_fleetid, string level, string nodeflag) { if (battleResult == null || battleResult.newShipVO == null || battleResult.newShipVO.Length == 0) { return; } var dic = new Dictionary <string, string>(); string desc = ""; UserShip flagship = GameData.instance.GetShipById(GameData.instance.UserFleets[battle_fleetid - 1].ships[0]); foreach (UserShip us in battleResult.newShipVO) { desc += level + "|" + nodeflag + "|" + us.ship.cid + "|" + us.ship.title + "|" + us.ship.star + "|" + ServerTimer.GetNowServerTime() + "|" + z.instance.getServerName() + "|" + flagship.level + "|" + flagship.ship.cid + "|" + flagship.ship.luck + "|" + flagship.ship.star + "|" + flagship.ship.title + "|" + (WarResultLevel)battleResult.warResult.resultLevel + "|" + battleResult.bossHpLeft + "|" + GameData.instance.UserInfo.detailInfo.collection + "|" + GameData.instance.UserInfo.level + "\r\n"; } dic["msg"] = desc; var c = new System.Net.Http.FormUrlEncodedContent(dic); try { var p = new System.Net.Http.HttpClient(); var r = p.PostAsync(tools.helper.count_server_addr + "/sssgbsssgb/reportdrop", c).Result; } catch (Exception) { } }
public void UpdateShip([Optional, DefaultParameterValue(null)] UserShip ship, [Optional, DefaultParameterValue(false)] bool isInExplore) { if (ship != null) { this.userShip = ship; } this.isInExplore = isInExplore; this.showShipInfo = base.GetComponent<ShowCommonShipInfo>(); if (this.showShipInfo != null) { this.showShipInfo.UpdateShip(this.userShip); } if (isInExplore) { this.inExploreMark.SetActive(true); this.blackMark.SetActive(true); } if (GameData.instance.IsShipInReapir(this.userShip.id)) { this.inRepairMark.SetActive(true); this.blackMark.SetActive(true); } this.oilWarningObj.SetActive((this.userShip.maxProps.oil - this.userShip.props.oil) > 0); this.ammoWarningObj.SetActive((this.userShip.maxProps.ammo - this.userShip.props.ammo) > 0); }
internal void trySupplyFleet(int battle_fleetid) { UserFleet uf = GameData.instance.GetFleetOfId(battle_fleetid); bool needsupply = false; if (uf != null) { foreach (var s in uf.ships) { UserShip us = GameData.instance.GetShipById(s); if (us.NeedSupplyAmount > 1) { needsupply = true; } } } if (needsupply == true) { ReqSupply component = new ReqSupply(); component.SupplyOneFleetSuccess += new EventHandler <EventArgs>(this.ontrySupplyFleetSuccess); component.SupplyOneFleetFail += new EventHandler <EventArgs>(this.ontrySupplyFleetFail); component.SupplyFleet(battle_fleetid, 0); } else { z.instance.setBattleStatus(BATTLE_STATUS.SUPPLY); } }
public void UpdateShip([Optional, DefaultParameterValue(null)] UserShip ship) { if (ship != null) { this.userShip = ship; } this.showShipInfo = base.GetComponent<ShowCommonShipInfo>(); if (this.showShipInfo != null) { this.showShipInfo.UpdateShip(this.userShip); } if (this.userShip != null) { this.oilNeedTM.text = this.userShip.RepairOilNeeds + string.Empty; this.oilNeedTM.Commit(); this.steelNeedTM.text = this.userShip.RepairSteelNeeds + string.Empty; this.steelNeedTM.Commit(); this.timeNeedTM.text = TimeFormatter.Get6DFormat(this.userShip.RepairTimeSecondsNeeds); this.timeNeedTM.Commit(); } if (this.inExploreObj != null) { this.inExploreObj.SetActive(this.userShip.IsInExplore); } }
public void RepalceShips(int fleetId, List <UserShip> ships) { string str = "["; for (int i = 0; i < ships.Count; i++) { UserShip ship = ships[i]; if (ship != null) { str = str + ship.id + string.Empty; } else { str = str + "0"; } if (i != (ships.Count - 1)) { str = str + ","; } } str = str + "]"; object[] objArray1 = new object[] { "boat/instantFleet/", fleetId, "/", str }; base.path = string.Concat(objArray1); base.SetupParams(null, new BaseWWWRequest.OnSuccess(this.onSuccess), new BaseWWWRequest.OnFail(this.onFail), true, ServerType.ChoosedServer); }
public FleetShipChangeRequest ToggleShipLock(UserShip userShip) { FleetShipChangeRequest component = new FleetShipChangeRequest(); component.ToggleLockStatus(userShip); return(component); }
internal void updateCurFleetInfo() { foreach (ButtonX b in ships) { b.Image = null; b.Location = new Point(b.Location.X, 12); } UserFleet uf = GameData.instance.GetFleetOfId(FleetID); if (uf == null) { return; } Text = "编辑舰队 -- " + uf.title; int i = 0; foreach (int j in uf.ships) { UserShip us = GameData.instance.GetShipById(j); if (us != null) { ships[i].Image = tools.helper.getShipBigImage(us, new Rectangle(0, 0, 192, 256)); } i++; } updateTeamProps(); }
private void updateNonDisList() { GridPanel panel = nondislist.PrimaryGrid; panel.Rows.Clear(); foreach (var cid in AllShipConfigs.instance.ShipCids) { ShipConfig sc = AllShipConfigs.instance.getShip(cid); var dlist = tools.configmng.instance.getDisShipList(); if (sc != null && dlist.ContainsKey(sc.cid.ToString()) == false && sc.cid < 20000000) { object[] vals = new object[6]; UserShip us = new UserShip(); us.shipCid = sc.cid; us.level = 1; us.battleProps = new ShipBattleProps(); us.battlePropsMax = new ShipBattleProps(); us.battleProps.hp = 1; us.battlePropsMax.hp = 1; vals[0] = "添加"; vals[1] = tools.helper.getstartstring(sc.star); vals[2] = tools.helper.getshiptype(sc.type); vals[3] = sc.title; vals[4] = null;//tools.helper.getShipSmallImage(us); vals[5] = sc.cid; GridRow gr = new GridRow(vals); panel.Rows.Add(gr); gr.RowHeight = 30; } } }
public void UpdateShip([Optional, DefaultParameterValue(null)] UserShip ship) { if (ship != null) { this.userShip = ship; } this.showShipInfo = base.GetComponent<ShowCommonShipInfo>(); if (this.showShipInfo != null) { this.showShipInfo.UpdateShip(this.userShip); } ShipConfig config = this.userShip.ship; if (this.atkLevelText != null) { this.SetLevel2(this.atkLevelText, config.atk, this.userShip.strengthenAttribute.atk / config.strengthenLevelUpExp, config.strengthenTop.atk / config.strengthenLevelUpExp, this.atkLevelMaxObj); this.SetLevel2(this.torpedoLevelText, config.torpedo, this.userShip.strengthenAttribute.torpedo / config.strengthenLevelUpExp, config.strengthenTop.torpedo / config.strengthenLevelUpExp, this.torpedoLevelMaxObj); this.SetLevel2(this.airDefLevelText, config.airDef, this.userShip.strengthenAttribute.air_def / config.strengthenLevelUpExp, config.strengthenTop.air_def / config.strengthenLevelUpExp, this.airDefLevelMaxObj); this.SetLevel2(this.defLevelText, config.def, this.userShip.strengthenAttribute.def / config.strengthenLevelUpExp, config.strengthenTop.def / config.strengthenLevelUpExp, this.defLevelMaxObj); } if (this.inExploreObj != null) { this.inExploreObj.SetActive(this.userShip.IsInExplore); } if (this.inRepairObj != null) { this.inRepairObj.SetActive(this.userShip.IsInRepair); } }
public void SetShip(UserShip userShip) { this.userShip = userShip; this.loveIsFull = userShip.love >= 100; this.ringAmount = GameData.instance.GetItemAmount(0x15b09); this.UpdateInfo(); }
public UserShipDrawable(UserShip data) { _sprite = new SFML.Graphics.Sprite(); _userShipData = data; _life = data._life; _sprite.Texture = new SFML.Graphics.Texture(data._shipSprite, new SFML.Graphics.IntRect(10, 10, 32, 32)); _sprite.Position = new SFML.Window.Vector2f(50, 50); }
private int GetAmountOf(UserShip us, int id) { if ((us.ship.evoNeedResource != null) && us.ship.evoNeedResource.ContainsKey(id + string.Empty)) { return(us.ship.evoNeedResource[id + string.Empty]); } return(0); }
public void AddUserShip(UserShip us) { if (us != null) { this._userShips.Add(us); this.shipsDic[us.id] = us; } }
public void AddUserShip(UserShip ship) { if (this.userShips == null) { this.userShips = new List<UserShip>(); } this.userShips.Add(ship); }
protected override void SetShipContent(GameObject go, UserShip ship) { ShipForSelectAsTarget component = go.GetComponent<ShipForSelectAsTarget>(); if (component != null) { component.UpdateShip(ship); } }
protected override void SetShipContent(GameObject go, UserShip ship) { ForSelectRepairShip component = go.GetComponent<ForSelectRepairShip>(); if (component != null) { component.UpdateShip(ship); } }
public void DeleteEquip(UserShip ship, int position) { this.oldEquipId = ship.equipmentArr[position].id; this.newEquipId = -1; object[] objArray1 = new object[] { "boat/removeEquipment/", ship.id, "/", position }; base.path = string.Concat(objArray1); base.SetupParams(null, new BaseWWWRequest.OnSuccess(this.onReqChangeSuccess), new BaseWWWRequest.OnFail(this.onReqChangeFail), true, ServerType.ChoosedServer, false); }
private void ShowLoveCapacityChangeEnd() { UnityEngine.Object.Destroy(this.loveCapacityAddObj); this.loveProgressText.gameObject.SetActive(true); this.userShip = GameData.instance.GetShipById(this.userShip.id); base.GetComponent<ShowDetailedShipInfo>().UpdateShip(this.userShip); this.UpdateLoveInfo(); GameObjectUtil.InstantiateItemAsChildOf(this.merriedEffectPopupPrefab, base.gameObject); }
public void DeleteUserShip(int shipId) { if (this.shipsDic.ContainsKey(shipId)) { UserShip item = this.shipsDic[shipId]; this.shipsDic.Remove(shipId); this._userShips.Remove(item); } }
private void updateshipinfo(UserShip us) { bg.BackgroundImage = tools.helper.OpenImage("res/png/bigbg/fullColor" + (us == null?1:us.ship.star) + ".png"); if (us == null) { biglihui.BackgroundImage = tools.helper.OpenImage("res/png/big_n/ship1024_normal_899.png"); } else { biglihui.BackgroundImage = tools.helper.OpenImage("res/png/" + (us.BrokenType == ShipBrokenType.noBroken ? "big_n/ship1024_normal_" : "big_po/ship1024_broken_") + us.ship.picId + ".png"); } int starlv = us == null ? 1 : us.ship.star; for (int i = 0; i < 6; i++) { stars[i].Visible = starlv > i; } shipnumber.Text = us == null ? "" : ("N.O. " + us.ship.picId); shiptitle.Text = us == null ? "" : (us.ship.title.Length < 3? " ":"") + us.ship.title; shipsubtitle.Text = us == null ? "" : us.ship.classNo; shiplevel.Text = (us == null ? "" :("Lv. " + us.level + " Exp:" + us.exp + "/" + us.nextExp)); if (us != null) { string s = us.ship.vow; string s2 = ""; if (s.Length > 32) { s2 = s.Substring(32); s = s.Substring(0, 32); } shipvow1.Text = s; shipvow2.Text = s2; modicon.Visible = us.ship.evoClass > 0; modicon.Image = tools.helper.OpenImage("res/png/bigbg/mod" + us.ship.evoClass + ".png"); } else { modicon.Visible = false; shipvow1.Text = "..."; shipvow2.Text = ""; } int shiptype = us == null ? 16 : (int)us.ship.type; if (shiptype < 1 || shiptype > 16) { shiptype = 16; } shiptypeicon.Image = tools.helper.OpenImage("res/png/icons/w" + shiptype + ".png"); }
public void SetUserShip(UserShip us, bool isFlag) { this.commonShipInfo = base.GetComponent<ShowCommonShipInfo>(); this.commonShipInfo.UpdateShip(us); CheckShipLoveUpdate component = base.GetComponent<CheckShipLoveUpdate>(); if (component != null) { component.SetUserShip(us); } }
private void selshiplist_RowClick(object sender, GridRowClickEventArgs e) { int shipid = (int)e.GridPanel.GetCell(e.GridRow.RowIndex, 9).Value; UserShip us = GameData.instance.GetShipById(shipid); if (us == null) { return; } selshipid = us.id; updateSel(us); }
private void evobtn_Click(object sender, EventArgs e) { UserShip us = GameData.instance.GetShipById(selshipid); if (us == null) { return; } ServerRequestManager.instance.ModifyShip(us); us = GameData.instance.GetShipById(selshipid); updateSel(us); }
public void UpdateShip([Optional, DefaultParameterValue(null)] UserShip ship) { if (ship != null) { this.userShip = ship; } this.si = base.GetComponent<ShipForSelectAsTarget>(); if (this.si != null) { this.si.UpdateShip(ship); } }
private void eatbutton_Click(object sender, EventArgs e) { List <int> food = new List <int>(); UserShip us = GameData.instance.GetShipById(selshipid); if (us == null) { return; } foreach (var v in sellist) { food.Add(v.id); } var rr = ServerRequestManager.instance.Strengthen(selshipid, food); if (rr != null && rr.responseData != null) { MessageBox.Show("强化成功"); } else { MessageBox.Show("强化失败,开客户端搞吧..."); Close(); } UserShip uus = GameData.instance.GetShipById(selshipid); sellist.Clear(); updateSel(uus); for (int rc = 0; rc < selshiplist.PrimaryGrid.Rows.Count; rc++) { if (((int)selshiplist.PrimaryGrid.GetCell(rc, 9).Value) == uus.id) { selshiplist.PrimaryGrid.GetCell(rc, 5).Value = "" + uus.strengthenAttribute.atk + "/" + uus.ship.strengthenTop.atk; selshiplist.PrimaryGrid.GetCell(rc, 6).Value = "" + uus.strengthenAttribute.torpedo + "/" + uus.ship.strengthenTop.torpedo; selshiplist.PrimaryGrid.GetCell(rc, 7).Value = "" + uus.strengthenAttribute.def + "/" + uus.ship.strengthenTop.def; selshiplist.PrimaryGrid.GetCell(rc, 8).Value = "" + uus.strengthenAttribute.air_def + "/" + uus.ship.strengthenTop.air_def; break; } } foreach (int shipeatten in food) { for (int rc = 0; rc < feedlist.PrimaryGrid.Rows.Count; rc++) { if (((int)feedlist.PrimaryGrid.GetCell(rc, 5).Value) == shipeatten) { feedlist.PrimaryGrid.Rows.RemoveAt(rc); break; } } } }
internal void updateCheckList(UserShip us) { if (sellist.Contains(us)) { sellist.Remove(us); } else { sellist.Add(us); } UserShip uus = GameData.instance.GetShipById(selshipid); updateSel(uus); }
public void ChangeEquip(UserShip ship, int position, int equpId) { if ((ship.equipmentArr.Length > position) && (ship.equipmentArr[position] != null)) { this.oldEquipId = ship.equipmentArr[position].id; } else { this.oldEquipId = -1; } this.newEquipId = equpId; object[] objArray1 = new object[] { "boat/changeEquipment/", ship.id, "/", equpId, "/", position }; base.path = string.Concat(objArray1); base.SetupParams(null, new BaseWWWRequest.OnSuccess(this.onReqChangeSuccess), new BaseWWWRequest.OnFail(this.onReqChangeFail), true, ServerType.ChoosedServer, false); }
public void UpdateShip(UserShip us) { this.us = us; this.cardParent.GetComponent<UpdateBigAvatarInfo>().SetShip(us.ship.picId, false); this.cardParent.SetActive(true); if (this.sTM != null) { this.sTM.Text = us.ship.vow; } else { this.getDialog.text = us.ship.vow; this.getDialog.Commit(); } }
public void updateTeamProps() { UserFleet uf = GameData.instance.GetFleetOfId(FleetID); if (uf == null) { return; } int[] prop = new int[7] { 0, 0, 0, 0, 0, 0, 0 }; double cvairval = 0.0f; foreach (int j in uf.ships) { UserShip us = GameData.instance.GetShipById(j); if (us != null) { prop[0] += us.battleProps.atk; prop[1] += us.battleProps.torpedo; prop[2] += us.battleProps.def; prop[3] += us.battleProps.antisub; prop[4] += us.battleProps.airDef; prop[5] += us.battleProps.radar; for (int index = 0; index < us.equipmentArr.Length; index++) { if (us.capacitySlotMax[index] <= 0) { continue; } var eq = us.equipmentArr[index].config; if (eq != null && eq.type == EquipmentType.FightPlane) { cvairval += Math.Sqrt((double)us.capacitySlotMax[index]) * (double)eq.airDef; } } } } label1.Text = "总火力: " + prop[0]; label2.Text = "总雷装: " + prop[1]; label3.Text = "总装甲: " + prop[2]; label4.Text = "总反潜: " + prop[3]; label5.Text = "总对空: " + prop[4]; label6.Text = "总索敌: " + prop[5]; label7.Text = "总制空值: " + cvairval; }
public void ChangeWeaponOfShip(object[] objs) { if (GlobalLock.instance.CanGo) { GlobalLock.instance.GoNow(); } else { return; } this.selectedShip = objs[0] as UserShip; this.selectedGO = objs[1] as GameObject; ChangeShipWeaponUI component = (UnityEngine.Object.Instantiate(this.shipWeaponChangeUIPrefab) as GameObject).GetComponent<ChangeShipWeaponUI>(); component.HideThis += new EventHandler<EventArgs>(this.OnHideThis); component.ShowThis += new EventHandler<EventArgs>(this.OnShowThis); component.EquipChanged += new EventHandler<EventArgs>(this.OnEquipChanged); component.UpdateShip(this.selectedShip); }
public void UpdateUserShip(UserShip newShip) { if (newShip != null) { if (this.shipsDic.ContainsKey(newShip.id)) { UserShip item = this.shipsDic[newShip.id]; this.shipsDic.Remove(newShip.id); this.shipsDic[newShip.id] = newShip; this._userShips.Remove(item); this._userShips.Add(newShip); } else { this.AddUserShip(newShip); } } }
public static GridRow getonerow(UserShip us) { object[] vals = new object[19]; vals[0] = us.fleetId > 0 ? (GameData.instance.UserFleets[us.fleetId - 1].title) : ""; vals[1] = us.level; vals[2] = us.ship.title; vals[3] = tools.helper.getshiptype(us.ship.type); vals[4] = tools.helper.getShipSmallImage(us); vals[5] = 100 * us.battleProps.hp / us.battlePropsMax.hp; vals[6] = "" + us.battleProps.hp + "/" + us.battlePropsMax.hp; vals[7] = "修理";// + "/" + us.battlePropsMax.atk; vals[8] = us.id; GridRow gr = new GridRow(vals); gr.RowHeight = 30; return gr; }
public void ToggleSelection(UserShip ship) { if (this.selectedShipsDic.ContainsKey(ship.id)) { this.selectedShipsDic.Remove(ship.id); this.selectedShips.Remove(ship); } else { if (this.selectedShips.Count >= this.maxSelection) { this.ShowMaxNotice(); return; } this.selectedShipsDic.Add(ship.id, true); this.selectedShips.Add(ship); } this.UpdateShipAfterSort(); }
private void addresult(UserShip us, ShipConfig sc) { var panel = dislist.PrimaryGrid; if (sc != null) { object[] vals = new object[6]; vals[0] = "" + sc.cid + "-" + sc.title; vals[1] = tools.helper.getstartstring(sc.star); vals[2] = tools.helper.getshiptype(sc.type); vals[3] = sc.title; vals[4] = tools.helper.getShipSmallImage(us); vals[5] = sc.cid; GridRow gr = new GridRow(vals); panel.Rows.Add(gr); gr.RowHeight = 30; } }
public void UpdateShip([Optional, DefaultParameterValue(null)] UserShip ship) { if (ship != null) { this.userShip = ship; } this.showShipInfo = base.GetComponent<ShowCommonShipInfo>(); if (this.showShipInfo != null) { this.showShipInfo.UpdateShip(this.userShip); } if (this.inExploreObj != null) { this.inExploreObj.SetActive(this.userShip.IsInExplore); } if (this.inRepairObj != null) { this.inRepairObj.SetActive(this.userShip.IsInRepair); } }
public void UpdateShip(UserShip us) { this.us = us; this.sc = base.GetComponent<ShowCommonShipInfo>(); this.sc.UpdateShip(us); if (this.sTM != null) { this.sTM.Text = us.ship.getDialogue; } else { this.getDialog.text = us.ship.getDialogue; this.getDialog.Commit(); } this.typeTM.text = Localization.Localize("ShipTypeDetail" + ((int) us.ship.type)); this.typeTM.Commit(); this.fullColor.ShowColorOf(us.ship.star); if (GameData.instance.IsShipNewUnlocked(us.ship.cid)) { this.newSign.SetActive(true); GameData.instance.SetShipHasUnlocked(us.ship.cid); } }
public void UpdateShipAfterSupply(UserShip newShip) { this.userShip = newShip; this.UpdateShipInfo(true); }
protected override void SetShipContent(GameObject go, UserShip ship) { ShipShowingWeaponForChange component = go.GetComponent<ShipShowingWeaponForChange>(); if (component != null) { component.UpdateShip(ship); } }
public static Image getShipSmallImage(UserShip us) { Bitmap bgsrc = tools.helper.OpenImage("res/png/bigbg/s" + us.ship.star + ".png") as Bitmap; Bitmap bigsrc = tools.helper.OpenImage("res/png/" + (us.BrokenType == ShipBrokenType.noBroken ? "head_n/ship64_normal_" : "head_po/ship64_broken_") + us.ship.picId + ".png") as Bitmap; Rectangle newsize = new Rectangle(0, 0, bigsrc.Width, bigsrc.Height); Bitmap shiptype = tools.helper.OpenImage("res/png/shiptype/" + (int)us.ship.type + ".png") as Bitmap; Bitmap target = new Bitmap(newsize.Width, newsize.Height); Bitmap barbg = tools.helper.OpenImage("res/png/bigbg/barbg.png") as Bitmap; Bitmap bar = tools.helper.OpenImage(getShipBarString(us.BrokenType)) as Bitmap; Font titleFont = new Font("微软雅黑", 16); SolidBrush titleBrush = new SolidBrush(Color.Black); using (Graphics g = Graphics.FromImage(target)) { g.DrawImage(bgsrc, new Rectangle(0, 0, target.Width, target.Height), new Rectangle(0, 0, bgsrc.Width, bgsrc.Height), GraphicsUnit.Pixel); g.DrawImage(bigsrc, new Rectangle(0, 0, target.Width, target.Height), new Rectangle(0,0, bigsrc.Width,bigsrc.Height), GraphicsUnit.Pixel); g.DrawImage(shiptype, new Rectangle(6, 6, shiptype.Width, shiptype.Height), new Rectangle(0, 0, shiptype.Width, shiptype.Height), GraphicsUnit.Pixel); //g.DrawString("Lv." + us.level + " " + us.ship.title, titleFont, titleBrush, new PointF(5.0f, 5.0f)); int hp = 100 * us.battleProps.hp / us.battlePropsMax.hp; int pos = hp * newsize.Height / 100; g.DrawImage(barbg, new Rectangle(newsize.Width - 10, 0, barbg.Width, newsize.Height), new Rectangle(0, 0, barbg.Width, barbg.Height), GraphicsUnit.Pixel); g.DrawImage(bar, new Rectangle(newsize.Width - 10, newsize.Height - pos, barbg.Width, pos), new Rectangle(0, 0, bar.Width, bar.Height), GraphicsUnit.Pixel); } bgsrc.Dispose(); bgsrc = null; bigsrc.Dispose(); bigsrc = null; shiptype.Dispose(); shiptype = null; barbg.Dispose(); barbg = null; bar.Dispose(); bar = null; titleFont.Dispose(); titleBrush.Dispose(); return target as Image; }
public static Image getShipBigImage( UserShip us, Rectangle newsize) { int borderid = 1; if(us.ship.evoClass>0) { borderid = 2; } if(us.married ==1) { borderid = 3; } Bitmap border = tools.helper.OpenImage("res/png/bigbg/border" + borderid + ".png") as Bitmap; Bitmap bgsrc = tools.helper.OpenImage("res/png/bigbg/fullColor" + us.ship.star + ".png") as Bitmap; Bitmap bigsrc = tools.helper.OpenImage("res/png/" + (us.BrokenType == ShipBrokenType.noBroken ? "big_n/ship1024_normal_" : "big_po/ship1024_broken_") + us.ship.picId + ".png") as Bitmap; Bitmap target = new Bitmap(newsize.Width, newsize.Height); Bitmap barbg = tools.helper.OpenImage("res/png/bigbg/barbg.png") as Bitmap; Bitmap bar = tools.helper.OpenImage(getShipBarString(us.BrokenType)) as Bitmap; Font titleFont = new Font("微软雅黑", 16); SolidBrush titleBrush = new SolidBrush(Color.Black); Rectangle crop = new Rectangle(128 + 48, 128, 1024 - 256 - 96, 1024 - 128); using (Graphics g = Graphics.FromImage(target)) { g.DrawImage(bgsrc, new Rectangle(0, 0, target.Width, target.Height), new Rectangle(128, 0, bgsrc.Width-256, bgsrc.Height), GraphicsUnit.Pixel); g.DrawImage(border, new Rectangle(0, 0, target.Width, target.Height), new Rectangle(0, 0, border.Width, border.Height), GraphicsUnit.Pixel); g.DrawImage(bigsrc, new Rectangle(0, 0, target.Width, target.Height), crop, GraphicsUnit.Pixel); g.DrawString("Lv." + us.level + " " + us.ship.title, titleFont, titleBrush, new PointF(5.0f, 5.0f)); int hp = 100 * newsize.Width * us.battleProps.hp / us.battlePropsMax.hp; g.DrawImage(barbg, new Rectangle(0, newsize.Height - 6, newsize.Width, 12), new Rectangle(0, 0, barbg.Width, barbg.Height), GraphicsUnit.Pixel); g.DrawImage(bar, new Rectangle(0, newsize.Height - 6, newsize.Width * hp /100 , 12), new Rectangle(0, 0, bar.Width, bar.Height), GraphicsUnit.Pixel); } return target as Image; }
internal static object getshipEattenString(UserShip cl) { string r = ""; r += " 火力 +" + cl.ship.strengthenSupplyExp.atk; r += " 雷装 +" + cl.ship.strengthenSupplyExp.torpedo; r += " 装甲 +" + cl.ship.strengthenSupplyExp.def; r += " 防空 +" + cl.ship.strengthenSupplyExp.air_def; return r; }
public void UpdateShip([Optional, DefaultParameterValue(null)] UserShip ship) { if (ship != null) { this.userShip = ship; } if (this.userShip != null) { this.shipConfig = this.userShip.ship; } }
public void SetUserShip(UserShip newShip) { this.userShip = newShip; }
private void ShowGetNewShip(UserShip us) { GameObjectUtil.InstantiateItemAsChildOf(this.getNewShipPrefab, base.gameObject).GetComponent<PVEGetNewShip>().UpdateShip(us); }
public void OnShipMerriedStatusChanged() { this.userShip = GameData.instance.GetShipById(this.userShip.id); this.UpdateShipInfo(); }