/// <summary> /// Context menu opening, updates the "plan to" menus /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void contextMenu_Opening(object sender, CancelEventArgs e) { tsSeparatorBrowser.Visible = tvSkillList.SelectedNode != null; tsmCollapse.Enabled = tsmCollapse.Visible = m_allExpanded; tsmExpand.Enabled = tsmExpand.Visible = !tsmCollapse.Enabled; // Update "show in..." menu planToMenu.Visible = showInMenuSeparator.Visible = showInSkillBrowserMenu.Visible = showInSkillExplorerMenu.Visible = tvSkillList.SelectedNode != null; if (tvSkillList.SelectedNode == null) { return; } // "Plan to N" menus SkillLevel skillLevel = (SkillLevel)tvSkillList.SelectedNode.Tag; Skill skill = skillLevel?.Skill; if (skill == null) { return; } planToMenu.Enabled = false; for (int i = 0; i <= 5; i++) { planToMenu.Enabled |= m_plan.UpdatesRegularPlanToMenu(planToMenu.DropDownItems[i], skill, i); } }
public void DeleteById(int id) // Delete function { SkillLevel emp = GetById(id); dbconn.SkillLevels.Remove(emp); dbconn.SaveChanges(); }
public override int GetHashCode() { int hash = 1; if (Id != 0) { hash ^= Id.GetHashCode(); } if (SkillID != 0) { hash ^= SkillID.GetHashCode(); } if (SkillIcon != 0) { hash ^= SkillIcon.GetHashCode(); } if (SkillName.Length != 0) { hash ^= SkillName.GetHashCode(); } if (SkillLevel != 0) { hash ^= SkillLevel.GetHashCode(); } if (SkillType != 0) { hash ^= SkillType.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
private void ConfigureLevels() { Levels = new List <SkillLevel>(); for (var i = 1; i <= 5; i++) { var level = new SkillLevel { Level = i, IsActive = false, Descriptors = new List <SkillDescriptor> { new SkillDescriptor { AppliesToTarget = false, Modifiers = new List <ModifierDescriptor> { new ModifierDescriptor { TargetProperty = TargetProperty.Defense, Operation = Operation.Addition, Value = (float)Math.Round(i * 35f / 5f, 0), Path = Path.CurrentHero, }, } } } }; Levels.Add(level); } }
public async Task <IActionResult> Edit(int?id) { if (!id.HasValue) { return(NotFound()); } var session = await _sessionBL.GetSession(id.Value); if (session == null) { return(NotFound()); } //If the user is not an Admin we need to do additional verification if (!User.IsInRole("Admin")) { // Get the user information var currentUser = await _userManager.GetUserAsync(User); var speaker = await _speakerBL.GetSpeaker(currentUser.SpeakerId.Value); //If the user is not the speaker for the session then they should not be able to edit it. if (!_sessionBL.IsSessionEditableBySpeaker(session.SessionId, speaker.SpeakerId)) { return(RedirectToAction(nameof(Index))); } } ViewBag.SkillLevels = SkillLevel.GetSkillLevels(); return(View(session)); }
public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } if (Job.Length != 0) { hash ^= Job.GetHashCode(); } if (Skill.Length != 0) { hash ^= Skill.GetHashCode(); } if (SkillLevel.Length != 0) { hash ^= SkillLevel.GetHashCode(); } if (Importance != 0) { hash ^= Importance.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
void Start() { pHud = GetComponent <PlayerHUD>(); death = GetComponent <Death>(); if (photonView.IsMine) { dataManager = GetComponent <PlayerControllerLoader>().inGameDataManager; } // see if the player has the Resilience skill SkillLevel resilienceLevel = GetComponent <PlayerControllerLoader>().skillManager.GetSkillByName("Resilience"); if (resilienceLevel != null) { // they have it, so set it skillModifier = resilienceLevel.Modifier; Debug.Log("Player has Resilience, modifier is: " + skillModifier); } else { Debug.Log("Player does NOT have Resilience"); } currentHealth = (int)(maxHealth * skillModifier); Debug.Log("Player is starting with current health: " + currentHealth); // this may cause problems when we implement the medpack }
public PlacementTest(Student student) { Student = student; Skill = SkillLevelDB.GetSkillLevel(Student.StudentLevel); NumberOfAttempts = 1; // student.DrillQuestionAttemps; // NumberOfQuestions = }
private void CreateTerrorVersions() { Levels = new List <SkillLevel>(); for (var i = 1; i <= 9; i++) { var level = new SkillLevel { Level = i, IsActive = false, Descriptors = new List <SkillDescriptor> { new SkillDescriptor { AppliesToTarget = false, Modifiers = new List <ModifierDescriptor> { new ModifierDescriptor { TargetProperty = TargetProperty.UnpoweredRoomAttackPowerBonus, Operation = Operation.Addition, Value = 32f + i * 4f, Path = Path.CurrentHero }, } } } }; Levels.Add(level); } }
//反撃不可フラグは「天狗のカメラ」の武器名だけで判定する //コンストラクタ public Weapon(string name, string annotation, string feature, WeaponType type, SkillLevel skillLevel, int[] parameter, int range, bool nfs, bool yuusha, bool isCloseAttack, bool isPrivate, string ownerName, StatusType statusType, int amount, RaceType slayer, bool isChaseInvalid) { this.name = name; this.annotationText = annotation; this.featureText = feature; this.type = type; this.skillLevel = skillLevel; this.attack = parameter[0]; this.hitRate = parameter[1]; this.criticalRate = parameter[2]; this.delay = parameter[3]; this.endurance = parameter[4]; this.maxEndurance = parameter[4]; this.price = parameter[5]; this.range = range; this.isNfs = nfs; this.isYuusha = yuusha; this.isCloseAttack = isCloseAttack; this.isPrivate = isPrivate; this.ownerName = ownerName; this.statusType = statusType; this.amount = amount; this.slayer = slayer; this.isChaseInvalid = isChaseInvalid; }
public async Task <IActionResult> Edit(int id, [Bind("Code,Description,Id")] SkillLevel skillLevel) { if (id != skillLevel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(skillLevel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SkillLevelExists(skillLevel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(skillLevel)); }
protected override void Awake() { base.Awake(); sonicWave = false; coolTime = 10.0f; Resources.Load("Character/Leesin/SonicWave"); animator = GetComponent <Animator>(); pc = this.transform.GetComponent <PlayerController>(); agent = transform.GetComponent <NavMeshAgent>(); Transform[] childrens = GetComponentsInChildren <Transform>(); foreach (Transform child in childrens) { if (child.name.Contains("l_hand")) { hand = child.gameObject; break; } } // factor { CurrentLevel = 0; skillFactor = 1.0f; LevelperValues = new SkillLevel[5]; LevelperValues[0] = new SkillLevel(1, 55, 50); LevelperValues[1] = new SkillLevel(2, 80, 50); LevelperValues[2] = new SkillLevel(3, 105, 50); LevelperValues[3] = new SkillLevel(4, 130, 50); LevelperValues[4] = new SkillLevel(5, 155, 50); } // }
public SessionViewModel ToSessionViewModel(Session session) { if (session == null) { return(null); } var speakerSessions = _context.SpeakerSessions .Include(ss => ss.Session) .Include(ss => ss.Speaker) .Include(ss => ss.Speaker.CodecampUser) .Where(ss => ss.SessionId == session.SessionId) .ToList(); var sessionViewModel = new SessionViewModel { SessionId = session.SessionId, Name = session.Name, Description = session.Description, SkillLevel = SkillLevel.GetSkillLevelDescription(session.SkillLevel), Keywords = session.Keywords, IsApproved = session.IsApproved, SpeakerSessions = speakerSessions, EventName = session.Event.Name }; return(sessionViewModel); }
// constructors public SkillGoal(Skill skill, SkillEvaluator skillEvaluator, SkillLevel targetSkillLevel, SkillLevel currentSkillLevel, Evaluation evaluation) : base() { if (skill == null) { throw new ArgumentNullException(nameof(skill)); } Evaluation = evaluation ?? throw new ArgumentNullException(nameof(evaluation)); Evaluatee = Evaluation.Evaluatee; TargetSkillLevel = targetSkillLevel; EvaluationPeriod = evaluation.EvaluationPeriod; SkillEvaluator = skillEvaluator ?? throw new ArgumentNullException(nameof(skillEvaluator)); SkillScore = new SkillScore(this); var existingPersonalSkill = Evaluatee.GetPersonalSkillFromProfile(skill); if (existingPersonalSkill != null) { existingPersonalSkill.SetSkillLevel(currentSkillLevel); InitialSkillLevel = new SkillSnapshot(new TrackingPoint(SkillEvaluator, EvaluationPeriod, EvaluationPeriod.StartDate), existingPersonalSkill); } else { InitialSkillLevel = new SkillSnapshot(new TrackingPoint(SkillEvaluator, EvaluationPeriod, EvaluationPeriod.StartDate), new PersonalSkill(skill, currentSkillLevel, Evaluatee.Employee.Profile)); } }
private static IEnumerable <Employee> FilterEmployeesEnumerable(object objD, object objS) { IEnumerable <Employee> filter = Enumerable.Empty <Employee>(); Department dep = null; SkillLevel skill = null; if (objD != null) { dep = (Department)objD; filter = dep.DepartmentStaff; } if (objS != null) { skill = (SkillLevel)objS; if (filter.Count() > 0) { filter = filter.Intersect(skill.Employees); } else { filter = skill.Employees; } } return(filter); }
public static void CreateSkillTemplates(Employee emp) { try { List <Skill> skills = db.Skills.ToList(); foreach (Skill skill in skills) { SkillLevel sk = db.SkillLevels.Where(x => x.SkillID == skill.SkillID && x.EmployeeID == emp.EmployeeID).FirstOrDefault(); if (sk == null) { sk = new SkillLevel(); sk.Level = 0; sk.SkillID = skill.SkillID; sk.EmployeeID = emp.EmployeeID; db.SkillLevels.Add(sk); } } db.SaveChanges(); } catch (Exception ex) { //error handling } }
/// <summary> /// Treeview's context menu > Plan "(selection)". /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsmAddToPlan_Click(object sender, EventArgs e) { CertificateLevel cert = treeView.SelectedNode.Tag as CertificateLevel; IPlanOperation operation; if (cert != null) { operation = m_plan.TryPlanTo(cert); } else { SkillLevel prereq = (SkillLevel)treeView.SelectedNode.Tag; operation = m_plan.TryPlanTo(prereq.Skill, prereq.Level); } if (operation == null) { return; } PlanWindow planWindow = ParentForm as PlanWindow; if (planWindow == null) { return; } PlanHelper.SelectPerform(new PlanToOperationWindow(operation), planWindow, operation); }
public override bool CheckAnswer(double studentAnswer) { bool isCorrect = Question.CheckAnswer(studentAnswer); if (isCorrect) { streak++; NumberOfCorrectAnswers++; //If the student get 3 right in a row then increase the skill level //by 1 after that if they get 2 right consecutively increase skill level by 1 if (streak >= 2) { Student.studentLevel += 1; Skill = SkillLevelDB.GetSkillLevel(Student.StudentLevel); streak = 0; } } else { NumberOfAttempts--; //Reset streak if they get a question wrong. streak = 0; } NumberOfQuestions++; return(isCorrect); }
/// <summary> /// Context menu > Show "skill" in browser | Show "certificate class" certificates. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void showInBrowserMenu_Click(object sender, EventArgs e) { // Retrieve the owner window PlanWindow npw = WindowsFactory <PlanWindow> .GetByTag(m_plan); if (npw == null || npw.IsDisposed) { return; } // Return when nothing is selected if (this.treeView.SelectedNode == null) { return; } Certificate cert = this.treeView.SelectedNode.Tag as Certificate; // When a certificate is selected, we select its class in the left tree if (cert != null) { npw.ShowCertInBrowser(cert); } // When a skill is selected, we select it in the skill browser else { SkillLevel prereq = (SkillLevel)this.treeView.SelectedNode.Tag; npw.ShowSkillInBrowser(prereq.Skill); } }
protected override void Awake() { base.Awake(); animator = GetComponent <Animator>(); Transform[] childrens = GetComponentsInChildren <Transform>(); foreach (Transform child in childrens) { if (child.name.Contains("ROOT")) { Root = child.gameObject; break; } } coolTime = 9.0f; // factor { CurrentLevel = 0; skillFactor = 0.3f; LevelperValues = new SkillLevel[5]; LevelperValues[0] = new SkillLevel(1, 40, 40); LevelperValues[1] = new SkillLevel(2, 65, 40); LevelperValues[2] = new SkillLevel(3, 90, 40); LevelperValues[3] = new SkillLevel(4, 115, 40); LevelperValues[4] = new SkillLevel(5, 140, 40); } // }
protected override void Awake() { base.Awake(); coolTime = 7.0f; animator = GetComponent <Animator>(); pc = GetComponent <PlayerController>(); Transform[] childrens = GetComponentsInChildren <Transform>(); foreach (Transform child in childrens) { if (child.name.Contains("weapon")) { weapon = child.gameObject; break; } } // factor { CurrentLevel = 0; skillFactor = 0.35f; LevelperValues = new SkillLevel[5]; LevelperValues[0] = new SkillLevel(1, 40, 65); LevelperValues[1] = new SkillLevel(2, 65, 70); LevelperValues[2] = new SkillLevel(3, 90, 75); LevelperValues[3] = new SkillLevel(4, 115, 80); LevelperValues[4] = new SkillLevel(5, 140, 85); } // }
//Method if the button is clicked private void button1_Click(object sender, EventArgs e) { //Set the correct radio button if (rdInvincible.Checked) { buttonChecked = rdButtons.Invincible; } else { buttonChecked = rdButtons.NoCheat; } //Set the correct skill level if (skillLevel.SelectedIndex == 0) { LevelSelected = SkillLevel.Beginner; } else if (skillLevel.SelectedIndex == 1) { LevelSelected = SkillLevel.Intermediate; } else { LevelSelected = SkillLevel.Advanced; } }
/// <summary> /// Constructor for prerequisites /// </summary> /// <param name="rows"></param> /// <param name="level"></param> /// <param name="prereq"></param> private Cell(SkillLevel prereq, List <Row> rows, int level) { Skill = prereq.Skill; RequiredLevel = prereq.Level; // Put on the appropriate row if (rows.Count == level) { rows.Add(new Row(this)); } else { rows[level].Add(this); } // Create the children foreach (var childPrereq in prereq.Skill.Prerequisites) { // Ignore recursive prereqs, happens with non-public skills like Polaris if (childPrereq.Skill == prereq.Skill) { continue; } Cells.Add(new Cell(childPrereq, rows, level + 1)); } }
//Constructor for settings box that takes an rdButtons and SkillLevel public SettingsBox(rdButtons button, SkillLevel level) { InitializeComponent(); //Set the rsButtons from button if (button == rdButtons.Invincible) { rdInvincible.Checked = true; } else { rdNoCheat.Checked = true; } //Set the skill level from level if (level == SkillLevel.Beginner) { skillLevel.SelectedIndex = 0; } else if (level == SkillLevel.Intermediate) { skillLevel.SelectedIndex = 1; } else { skillLevel.SelectedIndex = 2; } }
// Start is called before the first frame update protected override void Awake() { base.Awake(); coolTime = 130.0f; animator = GetComponent <Animator>(); Transform[] childrens = GetComponentsInChildren <Transform>(); foreach (Transform child in childrens) { if (child.name.Contains("ROOT")) { ROOT = child.gameObject; break; } } // factor { CurrentLevel = 0; skillFactor = 0.35f; LevelperValues = new SkillLevel[5]; LevelperValues[0] = new SkillLevel(1, 60, 100); LevelperValues[1] = new SkillLevel(2, 90, 100); LevelperValues[2] = new SkillLevel(3, 120, 100); } // }
public async Task <IActionResult> Edit(int id, SkillLevel skillLevel) { if (id != skillLevel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(skillLevel); await _context.SaveChangesAsync(); TempData["Toast"] = Toasts.Saved; } catch (DbUpdateConcurrencyException) { if (!SkillLevelExists(skillLevel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(skillLevel)); }
/// <summary> /// Updates the specified node and its children. /// </summary> /// <param name="node"></param> private void UpdateNode(TreeNode node) { CertificateLevel certLevel = node.Tag as CertificateLevel; // The node represents a certificate if (certLevel != null) { if (m_character != null) { if (certLevel.IsTrained) { node.ImageIndex = imageList.Images.IndexOfKey(TrainedIcon); } else if (certLevel.IsPartiallyTrained) { node.ImageIndex = imageList.Images.IndexOfKey(TrainableIcon); } else { node.ImageIndex = imageList.Images.IndexOfKey(UntrainableIcon); } } } // The node represents a skill prerequisite else { SkillLevel skillPrereq = (SkillLevel)node.Tag; Skill skill = m_character?.Skills[skillPrereq.Skill.ID] ?? skillPrereq.Skill; if (m_character != null) { if (skillPrereq.IsTrained) { node.ImageIndex = imageList.Images.IndexOfKey(TrainedIcon); } else if (m_plan != null && m_plan.IsPlanned(skill, skillPrereq.Level)) { node.ImageIndex = imageList.Images.IndexOfKey(PlannedIcon); } else if (skill.IsKnown) { node.ImageIndex = imageList.Images.IndexOfKey(TrainableIcon); } else { node.ImageIndex = imageList.Images.IndexOfKey(UntrainableIcon); } } } // When selected, the image remains the same node.SelectedImageIndex = node.ImageIndex; // Update the children foreach (TreeNode child in node.Nodes) { UpdateNode(child); } }
public Game(SkillLevel level) { Level = level; State = GameState.Stopped; Settings = GetFieldSettings(level); Minefield = new Field(Settings.Width, Settings.Height, Settings.MineCount); Result = null; }
public static KeyValuePair <Skill, short> MakeSkillLevelPair(SkillLevel source) { if (source.skill == null) { return(new KeyValuePair <Skill, short>()); } return(new KeyValuePair <Skill, short>(source.skill, source.level)); }
public ActionResult DeleteConfirmed(int id) { SkillLevel skillLevel = db.SkillLevels.Find(id); db.SkillLevels.Remove(skillLevel); db.SaveChanges(); return(RedirectToAction("Index")); }
public Skill(ICrestType type, int groupId, int categoryId, SkillLevel skillLevel = SkillLevel.V) : base(type, groupId, categoryId) { AddAttributeRange( new IAttribute[] { new ConstantAttribute(this, 280, "skillLevel", (int) skillLevel), new Attribute(this, 276, "skillPoints", true, true, 0) }); }
public BluePrintInfo(ItemCode code) : base(code) { if (!code.GetItemCategories().Any(c => c == ItemType.Blueprints)) throw new ArgumentException("Cannot create a blueprint from this itemCode"); Materials = Enumerable.Empty<ItemState>(); BuildRequirements = new SkillLevel[0]; BuildLength = 1; }
/// <summary> /// 棋力別の得票ポイントを設定します。 /// </summary> public void SetSkillPoint(SkillLevel skillLevel, int point) { using (LazyLock()) { this.skillPointTable[skillLevel] = point; this.RaisePropertyChanged("MoveList"); } }
/// <summary> /// Create a node from a prerequisite skill. /// </summary> /// <param name="skillPrereq"></param> /// <returns></returns> private static TreeNode CreateNode(SkillLevel skillPrereq) { TreeNode node = new TreeNode { Text = skillPrereq.ToString(), Tag = skillPrereq }; // Add this skill's prerequisites foreach (SkillLevel prereqSkill in skillPrereq.Skill.Prerequisites .Where(prereqSkill => prereqSkill.Skill != skillPrereq.Skill)) { node.Nodes.Add(CreateNode(prereqSkill)); } return node; }
/// <summary> /// Draws the list item for the given standing /// </summary> /// <param name="standing"></param> /// <param name="e"></param> private void DrawItem(Standing standing, DrawItemEventArgs e) { Graphics g = e.Graphics; // Draw background g.FillRectangle(e.Index % 2 == 0 ? Brushes.White : Brushes.LightGray, e.Bounds); Skill diplomacySkill = Character.Skills[DBConstants.DiplomacySkillID]; Skill connectionsSkill = Character.Skills[DBConstants.ConnectionsSkillID]; SkillLevel diplomacySkillLevel = new SkillLevel(diplomacySkill, diplomacySkill.LastConfirmedLvl); SkillLevel connectionsSkillLevel = new SkillLevel(connectionsSkill, connectionsSkill.LastConfirmedLvl); // Texts string standingText = $"{standing.EntityName} {standing.EffectiveStanding:N2}"; string standingStatusText = $"({Standing.Status(standing.EffectiveStanding)})"; string standingsDetailsText = $"{(standing.StandingValue < 0 ? diplomacySkillLevel : connectionsSkillLevel)} " + $"raises your effective standing from {standing.StandingValue:N2}"; // Measure texts Size standingTextSize = TextRenderer.MeasureText(g, standingText, m_standingsBoldFont, Size.Empty, Format); Size standingStatusTextSize = TextRenderer.MeasureText(g, standingStatusText, m_standingsBoldFont, Size.Empty, Format); Size standingsDetailsTextSize = TextRenderer.MeasureText(g, standingsDetailsText, m_standingsFont, Size.Empty, Format); bool standingsDiffer = Math.Abs(standing.EffectiveStanding - standing.StandingValue) > double.Epsilon; // Draw texts TextRenderer.DrawText(g, standingText, m_standingsBoldFont, new Rectangle( e.Bounds.Left + standing.EntityImage.Width + 4, e.Bounds.Top + (standingsDiffer ? PadTop : (e.Bounds.Height - standingTextSize.Height) / 2), standingTextSize.Width + PadLeft, standingTextSize.Height), Color.Black); TextRenderer.DrawText(g, standingStatusText, m_standingsBoldFont, new Rectangle( e.Bounds.Left + standing.EntityImage.Width + 4 + standingTextSize.Width + PadRight, e.Bounds.Top + (standingsDiffer ? PadTop : (e.Bounds.Height - standingStatusTextSize.Height) / 2), standingStatusTextSize.Width + PadLeft, standingStatusTextSize.Height), GetStatusColor(Standing.Status(standing.EffectiveStanding))); if (standingsDiffer) { TextRenderer.DrawText(g, standingsDetailsText, m_standingsFont, new Rectangle( e.Bounds.Left + standing.EntityImage.Width + 4, e.Bounds.Top + PadTop + standingTextSize.Height, standingsDetailsTextSize.Width + PadLeft, standingsDetailsTextSize.Height), Color.Black); } // Draw the entity image if (Settings.UI.SafeForWork) return; g.DrawImage(standing.EntityImage, new Rectangle(e.Bounds.Left + PadLeft / 2, StandingDetailHeight / 2 - standing.EntityImage.Height / 2 + e.Bounds.Top, standing.EntityImage.Width, standing.EntityImage.Height)); }
public BluePrintInfo() { Materials = Enumerable.Empty<ItemState>(); BuildRequirements = new SkillLevel[0]; BuildLength = 1; }
public SportWithSkillLevel() { SkillLevel = new SkillLevel(); }
private SkillLevel ShowSkillLevel(SkillLevel level, Skill skill) { if(skill.isPassive) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical("box"); fold8 = EditorGUILayout.Foldout(fold8, "Element effectiveness"); if(fold8) { for(int i=0; i<pw.GetElementCount(); i++) { EditorGUILayout.BeginHorizontal(); level.elementValue[i] = EditorGUILayout.IntField(pw.GetElement(i), level.elementValue[i], GUILayout.Width(pw.mWidth)); level.elementOperator[i] = (SimpleOperator)this.EnumToolbar("", (int)level.elementOperator[i], typeof(SimpleOperator)); EditorGUILayout.EndHorizontal(); } this.Separate(); } EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("box"); fold11 = EditorGUILayout.Foldout(fold11, "Race damage factor changes"); if(fold11) { for(int i=0; i<level.raceValue.Length; i++) { level.raceValue[i] = EditorGUILayout.IntField(DataHolder.Race(i), level.raceValue[i], GUILayout.Width(pw.mWidth)); } this.Separate(); } EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("box"); fold13 = EditorGUILayout.Foldout(fold13, "Size damage factor changes"); if(fold13) { for(int i=0; i<level.sizeValue.Length; i++) { level.sizeValue[i] = EditorGUILayout.IntField(DataHolder.Size(i), level.sizeValue[i], GUILayout.Width(pw.mWidth)); } this.Separate(); } EditorGUILayout.EndVertical(); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical("box"); fold16 = EditorGUILayout.Foldout(fold16, "Bonus/difficulty settings"); if(fold16) { EditorHelper.BonusSettings(ref level.bonus, false); this.Separate(); } EditorGUILayout.EndVertical(); } else { EditorGUILayout.BeginVertical("box"); fold2 = EditorGUILayout.Foldout(fold2, "Skill Settings"); if(fold2) { EditorGUILayout.Separator(); if(selection != tmpSel) this.tmpAudio = null; if(this.tmpAudio == null && "" != level.audioName) { this.tmpAudio = (AudioClip)Resources.Load(SkillData.AUDIO_PATH+ level.audioName, typeof(AudioClip)); } this.tmpAudio = (AudioClip)EditorGUILayout.ObjectField("Use audio", this.tmpAudio, typeof(AudioClip), false, GUILayout.Width(pw.mWidth*2)); if(this.tmpAudio) level.audioName = this.tmpAudio.name; else level.audioName = ""; EditorGUILayout.Separator(); level.skillElement = EditorGUILayout.Popup("Skill element", level.skillElement, pw.GetElements(), GUILayout.Width(pw.mWidth)); level.counterable = EditorGUILayout.Toggle("Counterable", level.counterable, GUILayout.Width(pw.mWidth)); level.reflectable = EditorGUILayout.Toggle("Reflectable", level.reflectable, GUILayout.Width(pw.mWidth)); level.revive = EditorGUILayout.Toggle("Revive target", level.revive, GUILayout.Width(pw.mWidth)); if(DataHolder.BattleSystem().CanUseSkillCasting()) { EditorGUILayout.Separator(); if(skill.useInBattle) { EditorGUILayout.BeginHorizontal(); level.castTime = EditorGUILayout.FloatField("Cast time", level.castTime, GUILayout.Width(pw.mWidth)); if(level.castTime > 0) { level.cancelable = EditorGUILayout.Toggle("Cancelable", level.cancelable, GUILayout.Width(pw.mWidth)); } if(level.castTime < 0) level.castTime = 0; GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); } else level.castTime = 0; if(DataHolder.BattleSystem().IsActiveTime()) { level.endTurn = EditorGUILayout.Toggle("End turn", level.endTurn, GUILayout.Width(pw.mWidth)); if(!level.endTurn) { level.timebarUse = EditorGUILayout.FloatField("Timebar use", level.timebarUse, GUILayout.Width(pw.mWidth)); if(level.timebarUse <= 0) level.timebarUse = 1; } } } else level.castTime = 0; EditorGUILayout.Separator(); EditorGUILayout.BeginHorizontal(); level.skillReuse = (StatusEffectEnd)this.EnumToolbar("Reuse after", (int)level.skillReuse, typeof(StatusEffectEnd)); if(!StatusEffectEnd.NONE.Equals(level.skillReuse)) { level.reuseTime = EditorGUILayout.FloatField( level.reuseTime, GUILayout.Width(pw.mWidth*0.5f)); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); EditorGUILayout.Separator(); EditorGUILayout.BeginHorizontal(GUILayout.Width(pw.mWidth*1.5f)); level.hitChance = EditorGUILayout.BeginToggleGroup("Calculate hit chance", level.hitChance); level.hitFormula = EditorGUILayout.Popup(level.hitFormula, pw.GetFormulas()); EditorGUILayout.EndToggleGroup(); EditorGUILayout.EndHorizontal(); EditorGUILayout.Separator(); EditorGUILayout.BeginHorizontal(GUILayout.Width(pw.mWidth*1.5f)); level.battleAnimation = EditorGUILayout.BeginToggleGroup("Use battle animation", level.battleAnimation); level.animationID = EditorGUILayout.Popup(level.animationID, DataHolder.BattleAnimations().GetNameList(true)); EditorGUILayout.EndToggleGroup(); EditorGUILayout.EndHorizontal(); if(!DataHolder.Skill(selection).TargetNone() && !DataHolder.Skill(selection).TargetSelf()) { level.useRange = EditorHelper.UseRangeSettings(level.useRange); } else level.useRange.active = false; this.Separate(); } EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("box"); fold12 = EditorGUILayout.Foldout(fold12, "Steal chance"); if(fold12) { EditorHelper.StealChanceSettings(ref level.stealChance); this.Separate(); } EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("box"); fold3 = EditorGUILayout.Foldout(fold3, "User Settings"); if(fold3) { GUILayout.Label ("Consume Status Value", EditorStyles.boldLabel); for(int i=0; i<pw.GetStatusValueCount(); i++) { if(pw.IsStatusValueConsumable(i)) { level.userConsume[i] = EditorHelper.ValueChangeSettings(i, level.userConsume[i]); } else { level.userConsume[i] = new ValueChange(); } } this.Separate(); } EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("box"); fold4 = EditorGUILayout.Foldout(fold4, "Target Settings"); if(fold4) { if(DataHolder.BattleSystem().IsTurnBased() && !DataHolder.BattleSystem().dynamicCombat) { level.orderChange = EditorGUILayout.IntField("Order change", level.orderChange, GUILayout.Width(pw.mWidth)); } EditorGUILayout.Separator(); GUILayout.Label ("Consume Status Value", EditorStyles.boldLabel); for(int i=0; i<pw.GetStatusValueCount(); i++) { if(pw.IsStatusValueConsumable(i)) { level.targetConsume[i] = EditorHelper.ValueChangeSettings(i, level.targetConsume[i]); } else { level.targetConsume[i] = new ValueChange(); } } this.Separate(); } EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(); } EditorGUILayout.BeginVertical("box"); fold5 = EditorGUILayout.Foldout(fold5, "Status Effects"); if(fold5) { for(int i=0; i<pw.GetStatusEffectCount(); i++) { level.skillEffect[i] = (SkillEffect)this.EnumToolbar(pw.GetStatusEffect(i), (int)level.skillEffect[i], typeof(SkillEffect)); } this.Separate(); } EditorGUILayout.EndVertical(); if(!skill.isPassive) { EditorGUILayout.BeginVertical("box"); fold6 = EditorGUILayout.Foldout(fold6, "Useable after (skill combo)"); if(fold6) { if(GUILayout.Button("Add", GUILayout.Width(pw.mWidth2))) { level.AddSkillCombo(); } for(int i=0; i<level.skillCombo.Length; i++) { EditorGUILayout.BeginHorizontal(); if(GUILayout.Button("Remove", GUILayout.Width(pw.mWidth3))) { level.RemoveSkillCombo(i); break; } level.skillCombo[i] = EditorGUILayout.Popup(level.skillCombo[i], DataHolder.Skills().GetNameList(true), GUILayout.Width(pw.mWidth)); EditorGUILayout.EndHorizontal(); } } EditorGUILayout.EndVertical(); } EditorGUILayout.EndVertical(); return level; }
public static SkillLevel[] Add(SkillLevel n, SkillLevel[] list) { ArrayList tmp = new ArrayList(); foreach(SkillLevel str in list) tmp.Add(str); tmp.Add(n); return tmp.ToArray(typeof(SkillLevel)) as SkillLevel[]; }
/// <summary> /// 棋力別の得票ポイントを取得します。 /// </summary> public int GetSkillPoint(SkillLevel skillLevel) { using (LazyLock()) { int point; if (!this.skillPointTable.TryGetValue(skillLevel, out point)) { return this.defaultSkillPoint; } return point; } }
public void SetBaseValues(float coolDown, int price, int manaCost, string skillName, SkillLevel skillLevel, string discription = null) { this.coolDown = coolDown; this.price = price; this.manaCost = manaCost; this.skillName = skillName; this.skillLevel = skillLevel; this.skillDiscription = discription; }
/// <summary> /// 棋力を文字列化します。 /// </summary> public static string ToString(SkillLevel skillLevel) { if (!string.IsNullOrEmpty(skillLevel.OriginalText)) { var text = skillLevel.OriginalText; return (text.Length > 12 ? text.Substring(0, 12) : text); } var n = IntConverter.Convert(NumberType.Grade, skillLevel.Grade); switch (skillLevel.Kind) { case SkillKind.Kyu: return (n + "級"); case SkillKind.Dan: return (n + "段"); case SkillKind.Unknown: return ""; } return ""; }
/// <summary> /// gets the collection of json skill levels /// </summary> /// <param name="levels"></param> /// <returns></returns> public static JsonLevel[] SkillLevels(SkillLevel[] levels) { List<JsonLevel> result = new List<JsonLevel>(); Array.ForEach(levels, l => { result.Add(SkillLevel(l)); }); return result.ToArray<JsonLevel>(); }
public static SkillLevel[] Remove(int index, SkillLevel[] list) { ArrayList tmp = new ArrayList(); foreach(SkillLevel str in list) tmp.Add(str); tmp.RemoveAt(index); return tmp.ToArray(typeof(SkillLevel)) as SkillLevel[]; }
public static JsonLevel SkillLevel(SkillLevel skillLevel) { if (skillLevel==null) { return new JsonLevel() { }; } return new JsonLevel() { id = skillLevel.Level, title = skillLevel.Tag }; }