Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiedEventArgs"/> class.
 /// </summary>
 /// <param name="target"><inheritdoc cref="Target"/></param>
 /// <param name="targetOldRole">Target's old <see cref="RoleType"/>.</param>
 /// <param name="damageHandler"><inheritdoc cref="DamageHandler"/></param>
 public DiedEventArgs(Player target, RoleType targetOldRole, DamageHandlerBase damageHandler)
 {
     Handler       = new CustomDamageHandler(target, damageHandler);
     Killer        = Handler.BaseIs(out CustomAttackerHandler attackerDamageHandler) ? attackerDamageHandler.Attacker : null;
     Target        = target;
     TargetOldRole = targetOldRole;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DyingEventArgs"/> class.
 /// </summary>
 /// <param name="target"><inheritdoc cref="Target"/></param>
 /// <param name="damageHandler"><inheritdoc cref="DamageHandler"/></param>
 public DyingEventArgs(Player target, DamageHandlerBase damageHandler)
 {
     Handler     = new CustomDamageHandler(target, damageHandler);
     ItemsToDrop = new List <Item>(target.Items.ToList());
     Killer      = Handler.BaseIs(out CustomAttackerHandler attackerDamageHandler) ? attackerDamageHandler.Attacker : null;
     Target      = target;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HurtingEventArgs"/> class.
 /// </summary>
 /// <param name="target"><inheritdoc cref="Target"/></param>
 /// <param name="damageHandler"><inheritdoc cref="DamageHandler"/></param>
 public HurtingEventArgs(Player target, DamageHandlerBase damageHandler)
 {
     Handler  = new CustomDamageHandler(target, damageHandler);
     Attacker = Handler.BaseIs(out CustomAttackerHandler attackerDamageHandler)
         ? attackerDamageHandler.Attacker
         : null;
     Target = target;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnnouncingScpTerminationEventArgs"/> class.
 /// </summary>
 /// <param name="scp"><inheritdoc cref="Player"/></param>
 /// <param name="damageHandlerBase"><inheritdoc cref="DamageHandler"/></param>
 /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
 public AnnouncingScpTerminationEventArgs(Player scp, DamageHandlerBase damageHandlerBase, bool isAllowed = true)
 {
     Player           = scp;
     Role             = scp.ReferenceHub.characterClassManager.CurRole;
     Handler          = new CustomDamageHandler(scp, damageHandlerBase);
     Killer           = Handler.BaseIs(out CustomAttackerHandler customAttackerHandler) ? customAttackerHandler.Attacker : null;
     TerminationCause = damageHandlerBase.CassieDeathAnnouncement.Announcement;
     IsAllowed        = isAllowed;
 }