private DeathAbility(Combatant source, Combatant target) { Name = "Death"; Desc = "Death as a result of Death Sentence"; Type = AttackType.Physical; Target = BattleTarget.Combatant; Power = 0; Hitp = 255; HitFormula = PhysicalHit; Statuses = new StatusChange[] { new StatusChange(Status.Death, 100, StatusChange.Effect.Inflict) }; #if DEBUG Message = String.Format("[ {0} reaps {1} ]", source, target); #else Message = String.Empty; #endif }
public void Reset() { resolvedChange = new StatusChange(); resolvedChange.statusType = statusType; if (getChance() >= UnityEngine.Random.Range(0f, 1f)) { // We hit the chance! resolvedChange.permanent = permanent; resolvedChange.replace = replace; // TODO chance, also in tooltip resolvedChange.value = UnityEngine.Random.Range(min, max + 1); } else { resolvedChange.permanent = true; resolvedChange.replace = false; // TODO chance, also in tooltip resolvedChange.value = 0; } }
private PetrifyAbility(Combatant source, Combatant target) { Name = "Petrify"; Desc = "Petrification as a result of Slow-Numb"; Type = AttackType.Physical; Target = BattleTarget.Combatant; Power = 0; Hitp = 255; HitFormula = PhysicalHit; Statuses = new StatusChange[] { new StatusChange(Status.Petrify, 100, StatusChange.Effect.Inflict) }; #if DEBUG Message = String.Format("[ {0} had slow-numbed {1} ]", source, target); #else Message = String.Empty; #endif }
public void ChangeStatus(ChangeContentStatus command, StatusChange reason) { RaiseEvent(SimpleMapper.Map(command, new ContentStatusChanged { Change = reason })); }
public void RegisterStatusChangeHandler(StatusChange handler) { statusChangeHandler = handler; }
private void AlertStatusChange(string message, Action <string> logAction) { StatusChange?.Invoke(message, Status); logAction(message); }
public static Task <ContentData> ExecuteChangeScriptAsync(this ContentOperation operation, Status status, StatusChange change) { var script = operation.SchemaDef.Scripts.Change; if (string.IsNullOrWhiteSpace(script)) { return(Task.FromResult(operation.Snapshot.Data)); } // Clone the data so we do not change it by accident. var data = operation.Snapshot.Data.Clone(); var vars = Enrich(operation, new ScriptVars { [ScriptKeys.Data] = data, [ScriptKeys.DataOld] = null, [ScriptKeys.OldData] = null, [ScriptKeys.OldStatus] = operation.Snapshot.EditingStatus(), [ScriptKeys.Operation] = change.ToString(), [ScriptKeys.Status] = status, [ScriptKeys.StatusOld] = operation.Snapshot.EditingStatus() }); return(TransformAsync(operation, script, vars)); }
public AppStatus(object sender, StatusChange status) : base(sender) { Status = status; }
public ClientStatusPacket(StatusChange change) { Change = change; }
internal void UpdateVoiceState(JsonVoiceState state) { StatusChange change = StatusChange.Added; if (_stateDictionary.TryGetValue(state.UserId, out VoiceState voiceState)) { if (state.ChannelId != voiceState.Channel?.Id) { change = StatusChange.Updated; } else if (!state.ChannelId.HasValue) { change = StatusChange.Removed; } else { change = StatusChange.Moved; } } IAudioChannel?channel = state.ChannelId.HasValue ? (IAudioChannel?)_client.Channels.GetChannel(state.ChannelId.Value) : null; void AddState() { _stateDictionary.Add(state.UserId, voiceState); channel?.AddVoiceMember(state.UserId); _client.VoiceStateAdded?.Invoke(_client, voiceState); } void RemoveState() { _stateDictionary.Remove(state.UserId); channel?.RemoveVoiceMember(state.UserId); _client.VoiceStateRemoved?.Invoke(_client, voiceState); } switch (change) { case StatusChange.Added: voiceState = new VoiceState(state, _client); AddState(); break; case StatusChange.Removed: voiceState !.Update(state); RemoveState(); break; case StatusChange.Moved: voiceState !.Update(state); RemoveState(); AddState(); break; case StatusChange.Updated: voiceState !.Update(state); break; } _client.VoiceStateUpdated?.Invoke(_client, voiceState); }
public void SetCacheStatus(CacheStatus newStatus, string message) { _status = newStatus; StatusChange?.Invoke(_status, message); }
public void RepportStatus(string status) { Logger.Log <ProgressRepporter>(LoggerLevel.Info, status); Status = status; StatusChange?.Invoke(this, status); }
public StatusChange(Status status, int odds, StatusChange.Effect effect) { _odds = 100; ChangeType = effect; Statuses = new Status[] { status }; }
protected Ability() { Elements = new Element[] { }; Statuses = new StatusChange[] { }; Hits = 1; }
public void UnregisterStatusChangeHandler(StatusChange handler) { statusChangeHandler -= handler; }
/// <summary> /// Raises the status change event. /// </summary> /// <param name="e">The event delegates.</param> /// <param name="value">New value.</param> private void RaiseStatusChangeEvent(StatusChange e, bool value) { if (null != e) { e(value); } }
public T Calculator <T>(T status, T value, StatusChange <T> del) { return(del(status, value)); }
public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction) { Change = (StatusChange)stream.ReadUInt8(); return mode; }
public List <dynamic> GetUpdateCustomerStatus(StatusChange model) { List <dynamic> objDynamic = new List <dynamic>(); Int64 OrderID = 0, StatusID = 0, LeadTime = 0, intUserID = 0, intIncoID = 0, OAID = 0; int type = 0; String Remarks = string.Empty, SalesOrderNo = string.Empty; if (!string.IsNullOrEmpty(SecurityHelper.Decrypt(model.OrderID, false))) { OrderID = Convert.ToInt64(SecurityHelper.Decrypt(model.OrderID, false)); } if (!string.IsNullOrEmpty(model.Type)) { type = Convert.ToInt32(model.Type); } if (!string.IsNullOrEmpty(model.ChangedStatus)) { StatusID = Convert.ToInt32(model.ChangedStatus); } if (!string.IsNullOrEmpty(model.LeadTime)) { LeadTime = Convert.ToInt32(model.LeadTime); } if (!string.IsNullOrEmpty(model.IncoID)) { intIncoID = Convert.ToInt32(model.IncoID); } if (!string.IsNullOrEmpty(model.ApproverID)) { OAID = Convert.ToInt64(SecurityHelper.Decrypt(model.ApproverID, false)); } Remarks = model.Reason; SalesOrderNo = model.SalesOrderNo; DataSet ds = UpdateStatus(OrderID, StatusID, type, LeadTime, intUserID, intIncoID, Remarks, SalesOrderNo, OAID); string strCurrStatusID = ds.Tables[1].Rows[0]["StatusId"].ToString(); //DataTable dtstatustable = GetCustStatusDetail(StatusID.ToString(), ds.Tables[0]); DataTable dtstatustable = GetCustStatusDetail(strCurrStatusID, ds.Tables[0]); var myEnumerablecuststatus = dtstatustable.AsEnumerable(); List <CustomerStatusDetail> CustomerStatusDetail = (from item in myEnumerablecuststatus select new CustomerStatusDetail { StatusId = item.Field <Int64>("StatusId"), StatusName = item.Field <String>("StatusName"), StatusOrder = item.Field <int>("StatusOrder"), StatusCheck = item.Field <Boolean>("Statuscheck"), }).ToList(); objDynamic.Add(CustomerStatusDetail); try { GetEmailDetails(OrderID.ToString()); } catch (Exception ex) { } return(objDynamic); }