Exemple #1
0
        protected override float OnGetSlays(IFlagCollection flags)
        {
            float slays = 1.0f;

            // see if the attack has any flags that affect this monster's group(s)
            foreach (string group in Race.Groups)
            {
                if (flags.Has("useless-against-" + group))
                {
                    slays = 0.0f;
                }
                if (flags.Has("weak-against-" + group))
                {
                    slays *= 0.5f;
                }
                if (flags.Has("hurts-" + group))
                {
                    slays *= 2.0f;
                }
                if (flags.Has("wounds-" + group))
                {
                    slays *= 3.0f;
                }
                if (flags.Has("slays-" + group))
                {
                    slays *= 4.0f;
                }
            }

            return(slays);
        }
Exemple #2
0
        public Attack(Roller damage, int strikeBonus, float damageBonus,
                      Element element, string verb, EffectType effectType,
                      IFlagCollection flags)
        {
            mDamage      = damage;
            mStrikeBonus = strikeBonus;
            mDamageBonus = damageBonus;
            mElement     = element;

            Verb       = verb;
            EffectType = effectType;
            mFlags     = flags;
        }
Exemple #3
0
 public void UidAddFlagsSilent(int uid, IFlagCollection flags)
 {
     this.SourceClient.Command("uid store " + uid.ToString() + " +flags.silent " + ((FlagCollection)flags).Merged);
 }
Exemple #4
0
 /// <summary>
 /// Same as AddFlags() except no response is requested.
 /// </summary>
 /// <param name="messageOrdinal">The message's ordinal position.</param>
 /// <param name="flags">Flags to be added to the message.</param>
 /// <example><see cref="Mailbox.AddFlags"/></example>
 public void AddFlagsSilent(int messageOrdinal, IFlagCollection flags)
 {
     this.SourceClient.Command("store " + messageOrdinal.ToString() + " +flags.silent " + ((FlagCollection)flags).Merged);
 }
Exemple #5
0
 /// <summary>
 /// Sets the specified flags for the message.
 /// </summary>
 /// <param name="messageOrdinal">The message's ordinal position.</param>
 /// <param name="flags">Flags to be stored for the message.</param>
 /// <returns>The server's response.</returns>
 /// <example>
 /// <code>
 /// C#
 ///  
 /// Imap4Client imap = new Imap4Client();
 /// imap.Connect("mail.myhost.com");
 /// imap.Login("jdoe1234","tanstaaf");
 /// Mailbox inbox = imap.SelectInbox("inbox");
 /// FlagCollection flags = new FlagCollection();
 /// flags.Add("Read");
 /// flags.Add("Answered");
 /// inbox.AddFlags(1,flags);
 /// //Message is marked as read and answered. All prior flags are unset.
 /// imap.Disconnect();
 /// 
 /// VB.NET
 ///  
 /// Dim imap As New Imap4Client
 /// imap.Connect("mail.myhost.com")
 /// imap.Login("jdoe1234","tanstaaf")
 /// Dim inbox As Mailbox = imap.SelectInbox("inbox")
 /// Dim flags As New FlagCollection
 /// flags.Add("Read")
 /// flags.Add("Answered")
 /// inbox.AddFlags(1,flags)
 /// 'Message is marked as read and answered. All prior flags are unset.
 /// imap.Disconnect()
 /// 
 /// JScript.NET
 ///  
 /// var imap:Imap4Client imap = new Imap4Client();
 /// imap.Connect("mail.myhost.com");
 /// imap.Login("jdoe1234","tanstaaf");
 /// var inbox:Mailbox = imap.SelectInbox("inbox");
 /// var flags:FlagCollection = new FlagCollection();
 /// flags.Add("Read");
 /// flags.Add("Answered");
 /// inbox.AddFlags(1,flags);
 /// //Message is marked as read and answered. All prior flags are unset.
 /// imap.Disconnect();
 /// </code>
 /// </example>
 public string SetFlags(int messageOrdinal, IFlagCollection flags)
 {
     return this.SourceClient.Command("store " + messageOrdinal.ToString() + " flags " + ((FlagCollection)flags).Merged);
 }
Exemple #6
0
 public IAsyncResult BeginUidRemoveFlags(int uid, IFlagCollection flags, AsyncCallback callback)
 {
     this._delegateUidRemoveFlags = this.UidRemoveFlags;
     return this._delegateUidRemoveFlags.BeginInvoke(uid, flags, callback, this._delegateUidRemoveFlags);
 }
Exemple #7
0
 public IAsyncResult BeginRemoveFlags(int messageOrdinal, IFlagCollection flags, AsyncCallback callback)
 {
     this._delegateRemoveFlags = this.RemoveFlags;
     return this._delegateRemoveFlags.BeginInvoke(messageOrdinal, flags, callback, this._delegateRemoveFlags);
 }
Exemple #8
0
		/// <summary>
		/// Appends the provided message to the mailbox.
		/// </summary>
		/// <param name="messageData">The message in a Rfc822 compliant format.</param>
		/// <param name="flags">Flags to be set for the message.</param>
		/// <example><see cref="Mailbox.Append"/></example>
        public string Append(byte[] messageData, IFlagCollection flags)
		{
			return this.Append(System.Text.Encoding.ASCII.GetString(messageData,0,messageData.Length),flags);
		}
Exemple #9
0
 protected virtual float OnGetSlays(IFlagCollection flags)
 {
     // no slays by default
     return(1.0f);
 }
Exemple #10
0
 /// <summary>
 /// Appends the provided message to the mailbox.
 /// </summary>
 /// <param name="messageData">The message in a Rfc822 compliant format.</param>
 /// <param name="flags">Flags to be set for the message.</param>
 /// <param name="dateTime">The internal date to be set for the message.</param>
 public string Append(byte[] messageData, IFlagCollection flags, DateTime dateTime)
 {
     return this.Append(System.Text.Encoding.UTF8.GetString(messageData,0,messageData.Length),flags,dateTime);
 }
Exemple #11
0
 /// <summary>
 /// Appends the provided message to the mailbox.
 /// </summary>
 /// <param name="message">The message to be appended.</param>
 /// <param name="flags">Flags to be set for the message.</param>
 /// <param name="dateTime">The internal date to be set for the message.</param>
 /// <example>
 /// <code>
 /// C#
 ///  
 /// Message message = new Message();
 /// message.From = new Address("*****@*****.**","John Doe");
 /// message.To.Add("*****@*****.**","Mike Johns");
 /// message.Subject = "hey!";
 /// message.Attachments.Add("C:\\myfile.doc");
 /// message.HtmlBody.Text = "As promised, the requested document.&lt;br />&lt;br />Regards,&lt;br>John.";
 /// 
 /// FlagCollection flags = new FlagCollection();
 /// flags.Add("Read");
 /// 
 /// Imap4Client imap = new Imap4Client();
 /// Mailbox inbox = imap.SelectMailbox("Read Messages");
 /// inbox.Append(message,flags,System.DateTime.Now);
 /// imap.Disconnect();
 ///  
 /// VB.NET
 ///  
 /// Dim message As New Message
 /// message.From = new Address("*****@*****.**","John Doe")
 /// message.To.Add("*****@*****.**","Mike Johns")
 /// message.Subject = "hey!"
 /// message.Attachments.Add("C:\myfile.doc")
 /// message.HtmlBody.Text = "As promised, the requested document.&lt;br />&lt;br />Regards,&lt;br>John."
 /// 
 /// Dim flags As New FlagCollection
 /// flags.Add("Read")
 ///  
 /// Dim imap As New Imap4Client
 /// Dim inbox As Mailbox = imap.SelectMailbox("Read Messages")
 /// inbox.Append(message,flags,System.DateTime.Now)
 /// imap.Disconnect()
 ///   
 /// JScript.NET
 ///  
 /// var message:Message = new Message();
 /// message.From = new Address("*****@*****.**","John Doe")
 /// message.To.Add("*****@*****.**","Mike Johns");
 /// message.Subject = "hey!";
 /// message.Attachments.Add("C:\\myfile.doc");
 /// message.HtmlBody.Text = "As promised, the requested document.&lt;br />&lt;br />Regards,&lt;br>John."
 /// 
 /// var flags:FlagCollection = new FlagCollection();
 /// flags.Add("Read");
 ///  
 /// var imap:Imap4Client = new Imap4Client();
 /// var inbox:Mailbox = imap.SelectMailbox("Read Messages");
 /// inbox.Append(message,flags,System.DateTime.Now);
 /// imap.Disconnect();
 /// </code>
 /// </example>
 public string Append(Message message, IFlagCollection flags, DateTime dateTime)
 {
     return this.Append(message.ToMimeString(),flags,dateTime);
 }
Exemple #12
0
 public IAsyncResult BeginAppend(Message message, IFlagCollection flags, AsyncCallback callback)
 {
     this._delegateAppendMessageFlags = this.Append;
     return this._delegateAppendMessageFlags.BeginInvoke(message, flags, callback, this._delegateAppendMessageFlags);
 }
Exemple #13
0
 public IAsyncResult BeginAppend(string messageLiteral, IFlagCollection flags, DateTime dateTime, AsyncCallback callback)
 {
     this._delegateAppendFlagsDateTime = this.Append;
     return this._delegateAppendFlagsDateTime.BeginInvoke(messageLiteral, flags, dateTime, callback, this._delegateAppendFlagsDateTime);
 }
Exemple #14
0
 /// <summary>
 /// Appends the provided message to the mailbox.
 /// </summary>
 /// <param name="messageLiteral">The message in a Rfc822 compliant format.</param>
 /// <param name="flags">Flags to be set for the message.</param>
 /// <param name="dateTime">The internal date to be set for the message.</param>
 public string Append(string messageLiteral, IFlagCollection flags, DateTime dateTime)
 {
     string firststamp = System.DateTime.Now.ToString("yyMMddhhmmss"+System.DateTime.Now.Millisecond.ToString());
     this.SourceClient.Command("APPEND \"" + this.Name + "\" " + ((FlagCollection)flags).Merged + " " + dateTime.ToString("r") + " {" + (messageLiteral.Length) + "}", firststamp);
     return this.SourceClient.Command(messageLiteral,"",firststamp);
 }
Exemple #15
0
 public IAsyncResult BeginSetFlagsSilent(int messageOrdinal, IFlagCollection flags, AsyncCallback callback)
 {
     this._delegateSetFlagsSilent = this.SetFlagsSilent;
     return this._delegateSetFlagsSilent.BeginInvoke(messageOrdinal, flags, callback, this._delegateSetFlagsSilent);
 }
Exemple #16
0
 public IAsyncResult BeginUidSetFlagsSilent(int uid, IFlagCollection flags, AsyncCallback callback)
 {
     this._delegateUidSetFlagsSilent = this.UidSetFlagsSilent;
     return this._delegateUidSetFlagsSilent.BeginInvoke(uid, flags, callback, this._delegateUidSetFlagsSilent);
 }
Exemple #17
0
 public IAsyncResult BeginAppend(byte[] messageData, IFlagCollection flags, DateTime dateTime, AsyncCallback callback)
 {
     this._delegateAppendByteFlagsDateTime = this.Append;
     return this._delegateAppendByteFlagsDateTime.BeginInvoke(messageData, flags, dateTime, callback, this._delegateAppendByteFlagsDateTime);
 }
Exemple #18
0
 public string UidAddFlags(int uid, IFlagCollection flags)
 {
     return this.SourceClient.Command("uid store " + uid.ToString() + " +flags " + ((FlagCollection)flags).Merged);
 }
Exemple #19
0
        /// <summary>
        /// Appends the provided message to the mailbox.
        /// </summary>
        /// <param name="messageLiteral">The message in a Rfc822 compliant format.</param>
        /// <param name="flags">Flags to be set for the message.</param>
        /// <param name="dateTime">The internal date to be set for the message.</param>
        public string Append(string messageLiteral, IFlagCollection flags, DateTime dateTime)
        {
            string firststamp = System.DateTime.Now.ToString("yyMMddhhmmss" + System.DateTime.Now.Millisecond.ToString());

            // FIX by Hannes Sachsenhofer for Imapsy
            // Office365 did not like the non-standard date-format, so I changed it to the standard format
            var d = dateTime.ToUniversalTime().ToString("dd-MMM-yyyy hh:mm:ss +0000", CultureInfo.InvariantCulture);

            this.SourceClient.Command("APPEND \"" + this.Name + "\" " + ((FlagCollection)flags).Merged + " \"" + d + "\" {" + (messageLiteral.Length) + "}", firststamp);
            return this.SourceClient.Command(messageLiteral, "", firststamp);
        }