Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Spell casting - target

  
  1. #1
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Spell casting - target

    I'm unifying the check which verifies whether a spell can be casted on specific place.

    I defined the following values to be used in spells:
    Code:
    enum PowerCanCastFlags {
        /** Allow casting the spell on enemy creatures kept in custody. */
        PwCast_CustodyCrtrs  = 0x0001,
        /** Allow casting the spell on owned creatures not captured by enemy. */
        PwCast_OwnedCrtrs    = 0x0002,
        /** Allow casting the spell on creatures of allied players. */
        PwCast_AlliedCrtrs   = 0x0004,
        /** Allow casting the spell on creatures of enemy players. */
        PwCast_EnemyCrtrs    = 0x0008,
    
        /** Allow casting the spell on neutral walkable tiles - path, water, lava, rooms owned by neutrals. */
        PwCast_NeutrlGround  = 0x0010,
        /** Allow casting the spell on owned ground - rooms floor and claimed ground. */
        PwCast_OwnedGround   = 0x0020,
        /** Allow casting the spell on allied players ground - rooms floor and claimed ground. */
        PwCast_AlliedGround  = 0x0040,
        /** Allow casting the spell on enemy players ground - rooms floor and claimed ground. */
        PwCast_EnemyGround   = 0x0080,
    
        /** Allow casting the spell on neutral tall slabs - earth, wall, gold. */
        PwCast_NeutrlWall    = 0x0100,
        /** Allow casting the spell on owned tall slabs - own fortified wall. */
        PwCast_OwnedWall     = 0x0200,
        /** Allow casting the spell on tall slabs owned by allies - their fortified walls. */
        PwCast_AlliedWall    = 0x0400,
        /** Allow casting the spell on tall slabs owned by enemies - their fortified walls. */
        PwCast_EnemyWall     = 0x0800,
    
        /** Allow casting the spell on owned food things (chickens). */
        PwCast_OwnedFood     = 0x1000,
        /** Allow casting the spell on owned and neutral gold things (piles,pots etc.). */
        PwCast_OwnedGold     = 0x2000,
        /** Allow casting the spell on owned spellbooks. */
        PwCast_OwnedSpell    = 0x4000,
        /** There are no map-related conditions - allow casting the spell anywhere on map. */
        PwCast_Anywhere      = 0x8000,
    };
    #define PwCast_AllCrtrs (PwCast_CustodyCrtrs|PwCast_OwnedCrtrs|PwCast_AlliedCrtrs|PwCast_EnemyCrtrs)
    #define PwCast_AllGround (PwCast_NeutrlGround|PwCast_OwnedGround|PwCast_AlliedGround|PwCast_EnemyGround)
    #define PwCast_AllWall (PwCast_NeutrlWall|PwCast_OwnedWall|PwCast_AlliedWall|PwCast_EnemyWall)
    From the comment above every value, you may learn what will be its meaning; don't care about the other things.
    The "|" is used to merge values, so spell can be casted on both things.

    Now, I used those values in spell information struct:
    Code:
    struct SpellData spell_data[] = {
      {36, 11, 0,   0,   0,   0,   0,   0,  0, NULL,                 0, 0},      //[0] None
      { 0,  0, 0,   0,   0,   0,   0,   0,  0, NULL,                 0, PwCast_OwnedCrtrs|PwCast_OwnedGround|PwCast_OwnedGold}, //[1] Power Hand
      {36, 24, 0,  95, 118, 631, 648, 831,  5, NULL,                 0, PwCast_OwnedGround}, //[2] Make Digger
      {97,  0, 0, 394, 452, 636, 653, 834,  0, NULL,                 0, PwCast_OwnedCrtrs}, //[3] Must Obey
      { 0,  0, 0,   0,   0,   0,   0,   0,  0, NULL,                 0, PwCast_OwnedCrtrs|PwCast_OwnedFood}, //[4] Slap
      {36,  8, 1,  85, 108, 632, 649, 828, 12, sight_of_evil_expand_check,0, PwCast_Anywhere}, //[5] Sight of Evil
      {36,  6, 1,  93, 116, 633, 650, 826,  0, call_to_arms_expand_check, 1, PwCast_AllGround}, //[6] Call To Arms
      {36,  7, 1,  97, 120, 635, 652, 837, 10, general_expand_check, 0, PwCast_AllGround}, //[7] Cave in
      {36, 22, 0,  87, 110, 644, 661, 829,  8, general_expand_check, 1, PwCast_OwnedCrtrs|PwCast_AlliedCrtrs}, //[8] Heal Creature
      {41,  0, 0,  89, 112, 634, 651, 830,  0, general_expand_check, 0, PwCast_Anywhere},     //[9] Hold Audience
      {36, 17, 0, 101, 124, 640, 657, 833,  6, general_expand_check, 1, PwCast_AllGround},    //[10] Lightning
      {36, 19, 0,  99, 122, 637, 654, 838, 11, general_expand_check, 1, PwCast_OwnedCrtrs|PwCast_AlliedCrtrs}, //[11] Speed Creature
      {36, 20, 0, 103, 126, 638, 655, 825,  9, general_expand_check, 1, PwCast_OwnedCrtrs},   //[12] Protect
      {36, 21, 0, 105, 128, 639, 656, 832,  1, general_expand_check, 1, PwCast_OwnedCrtrs},   //[13] Conceal
      {36, 26, 0, 310, 319, 642, 659, 835,  3, general_expand_check, 1, PwCast_EnemyCrtrs|PwCast_CustodyCrtrs}, //[14] Disease
      {36, 27, 0, 306, 314, 641, 658, 827,  2, general_expand_check, 1, PwCast_EnemyCrtrs|PwCast_CustodyCrtrs}, //[15] Chicken
      {36, 25, 0, 308, 317, 643, 660, 839,  4, general_expand_check, 0, PwCast_AllWall}, //[16] Destroy Walls
      {36, 28, 0, 105, 128, 645, 662,   0,  0, NULL,                 0, PwCast_AllGround},    //[17] Time Bomb
      {36, 11, 0,  91, 114, 630, 647, 836,  7, NULL,                 1, PwCast_OwnedCrtrs},   //[18] Possession
      {98,  0, 0, 312, 321, 646, 663, 824,  0, NULL,                 0, PwCast_Anywhere},     //[19] Armageddon
      { 0,  0, 0,   0,   0,   0,   0,   0,  0, NULL,                 0, 0},      //[20]
    };
    What I need is a confirmation that I used correct values for every spell.
    Let me know if you see any errors.

  2. #2

    Default Re: Spell casting - target

    I can't understand: what did you change?

  3. #3
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Spell casting - target

    Let me simplify the question:

    Under what conditions each spell can be used?

    Ie. the hand spell can be used in these ways:
    - to pick up your own creatures which are not kept in enemy custody
    - to pick up gold, belonging either to you or laying on neutral ground
    - to pick up your own chickens
    - to drop all of these things on your own ground
    - to drop imps on neutral ground
    - to drop gold and chickens on your own creatures
    - to drop chickens on enemy creatures kept in custody

    Lack of such list caused me recently to forget about casting "heal" on enemies in custody, so it's quite important.

  4. #4
    Beetle Stanislas Dolcini's Avatar
    Join Date
    Aug 2012
    Location
    France
    Posts
    113
    Gamer IDs

    Steam ID: StanleySweet Raptr ID: stanleysweet

    Default Re: Spell casting - target

    Oh that happened to me was tring to heal creatures being tortured. In whic release is that fixed ? I hope to be able to upload them soon...

  5. #5
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Spell casting - target

    I made large changes in r654, but I'm not sure if everything works as it should. All spells should be tested.

  6. #6

    Default Re: Spell casting - target

    You forget to say "drop gold on your prisoners", thing that you can do in original DK. Can you do even after your changes?

  7. #7
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Spell casting - target

    Quote Originally Posted by friscmanseby View Post
    You forget to say "drop gold on your prisoners", thing that you can do in original DK. Can you do even after your changes?
    Actually, I didn't knew you could do that.
    And what was the purpose/effect of it?

  8. #8
    Awakening Game Master Metal Gear Rex's Avatar
    Join Date
    Sep 2009
    Posts
    5,689

    Default Re: Spell casting - target

    Quote Originally Posted by mefistotelis View Post
    Actually, I didn't knew you could do that.
    And what was the purpose/effect of it?
    Make them happy...? I don't think there really is much point to it.
    Dungeon Keeper 2 Patch: With More Balance and Pie [Hiatus]
    Forever Hiatus. Probably. Latest Version: 3.5 w/Levels 1-11 Revised.

    The Awakening: GM Powers Activate!
    Tesonu is napping!

  9. #9

    Default Re: Spell casting - target

    When you drop gold on your prisoners (both enemies or your own creatures) they return at max happiness, but they don't greet you... Yes, quite useless, but I mentioned for the sake of completeness...

  10. #10
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Spell casting - target

    What do you think, should it be possible to cast "destroy walls" on a terrain revealed by SOE?

Similar Threads

  1. Tunneller party target
    By Orionzorz in forum KeeperFX
    Replies: 1
    Last Post: August 11th, 2011, 08:55
  2. Hard to target creatures...
    By Skaruts in forum KeeperFX
    Replies: 13
    Last Post: May 29th, 2010, 00:39

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •