Login | Register  

This site uses DNS Made Easy. Use it for reliable and professional DNS services.

Latest 20 PostsMinimize
19 May 2012 02:00 PM
RE: Socials - Karak
19 May 2012 03:27 AM
16 May 2012 11:10 PM
RE: Socials - Karak
15 May 2012 01:44 PM
15 May 2012 11:26 AM
15 May 2012 09:40 AM
15 May 2012 07:13 AM
15 May 2012 03:37 AM
14 May 2012 08:37 PM
14 May 2012 08:36 PM
14 May 2012 08:00 PM
14 May 2012 09:33 AM
14 May 2012 08:12 AM
14 May 2012 07:19 AM
13 May 2012 11:12 PM
RE: Socials - Karak
13 May 2012 10:32 PM
13 May 2012 10:09 PM
13 May 2012 11:37 AM
13 May 2012 11:03 AM
13 May 2012 07:41 AM
ForumsMinimize
Rules - New Design
Last Post 12 Feb 2012 03:30 PM byFastalanasa. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
AuthorMessages
FastalanasaUser is Offline
Grumpy Half-Elf
Veteran Member
Veteran Member
Send Private Message
Posts:1015
Avatar

--
09 Feb 2012 10:31 PM  

Alrighty! I did a brain dump and wanted to put it somewhere online. First of all, I would like to turn this sort of code: 

public override void OnAddTalent()

{

    if (this.PlayerThing.Stats.ContainsKey("Mage"))

    {

        GameStat stat;

 

        this.PlayerThing.Stats.TryGetValue("Mage", out stat);

 

        this.mage = (StatWRM)stat;

    }

 

    if (this.PlayerThing.Attributes.ContainsKey("Damage"))

    {

        GameAttribute dmg;

 

        this.PlayerThing.Attributes.TryGetValue("Damage", out dmg);

 

        this.damageAttrib = (AttributeDamage)dmg;

 

        if (this.mage != null)

        {

            this.damageAttrib.Increase(this.mage.Value, this.PlayerThing);

        }

    }

 

    base.OnAddTalent();

}

 

Into something like this:

WarriorRogueMage.Rules.IncreaseAttributeUsingStat();

I've thought about what new rules to add to the gaming system, and here's a brain dump:

  • IncreaseStat
  • IncreaseSkill
  • IncreaseTalent
  • AddEffectToPlayer
  • AddEffectToPlayerTargets
  • DecreaseStat
  • DecreaseSkill
  • DecreaseTalent
  • SuppressSkill
  • SuppressTalent
  • IncreaseAttribute
  • DecreaseAttribute
  • SubstituteStatForAttribute
  • SuppressAttribute
  • EnableAttribute
  • EnableSkill
  • EnableTalent
  • DisableSense
  • EnableSense
  • IncreaseSenseSensitivity
  • DecreaseSenseSensitivity

One of the things that would first need to be done is to standarize the different stats and attributes to have OnAdd, OnRemove, OnActivate, OnDeactivate.

Anyways, this is a placeholder for the new Rules work.

FastalanasaUser is Offline
Grumpy Half-Elf
Veteran Member
Veteran Member
Send Private Message
Posts:1015
Avatar

--
12 Feb 2012 03:30 PM  

RuleSets are here!

I finally found a decent way to create rulesets. I've implemented the first four rules. These rules can be used across all kinds of objects inside the gaming system. The first four are:

  • AddStatToAttributeRule
  • DecreaseAttributeRule
  • IncreaseAttributeRule
  • SubstractStatFromAttributeRule

There are also unit tests that make sure that these are working appropriately.

I had to do some interesting "under the hood" work to get these to work property. The most onery task was to implement the System.IComparable interface in AttributeWRM and StatWRM. I'm doing some fancy conversion with generics, but I'm doing this so that the actual implementation of a rule is a one liner.

To increase an attribute, you do this:

new IncreaseAttributeRule().Execute(this.PlayerThing, "Damage", 2);

To decrease an attribute you do this:

new DecreaseAttributeRule().Execute(this.PlayerThing, "Damage", 2);

You can also do stuff a bit more complicated like adding the value of a stat to an attribute like this: 

new AddStatToAttributeRule<GameStat, GameAttribute>().Execute(this.PlayerThing, "Warrior", "Damage"); 

To reverse this rule, we do this: 

new SubstractStatFromAttributeRule<GameStat, GameAttribute>().Execute(this.PlayerThing, "Warrior", "Damage"); 

I needed to implement all of this functionality, to be able to build the basic combat system for WRM. I believe that this will let us move forward and implement spells with effects as well. Very exciting!

You are not authorized to post a reply.

Copyright 2007-2012 by WheelMUD  | Terms Of Use | Privacy Statement
Google Analytics Alternative