コード例 #1
0
 /// <summary>
 /// Invoked when a buff value of the player is modified.
 /// If their buildmode is on, we set buffs of PluginUtils.BuildModeBuffs on the player.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void OnBuffUpdate(object sender, PlayerBuffUpdateEventArgs e)
 {
     if (e.Player.IsBuildModeOn())
     {
         foreach (int buffID in PluginUtils.BuildModeBuffs)
         {
             e.Player.SetBuff(buffID, Int16.MaxValue);
         }
     }
 }
コード例 #2
0
ファイル: GetDataHandlers.cs プロジェクト: CXUtk/TShock
        private static bool OnPlayerBuffUpdate(byte id)
        {
            if (PlayerBuffUpdate == null)
                return false;

            var args = new PlayerBuffUpdateEventArgs
            {
                ID = id,
            };
            PlayerBuffUpdate.Invoke(null, args);
            return args.Handled;
        }