Implementing the restructure changes

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • PowerWyrm
    replied
    From 8cecbfb: the "DARKNESS" effect has been split in two, "DARKEN_AREA" and "TIMED_INC:BLIND". The problem with incrementing the "BLIND" counter is that it only checks vs the innate protection, that is PROT_BLIND. The old darkness effect was also checking vs RES_DARK. This makes half-orcs, which are innately resistant to darkness, suffer from blindness when reading a scroll of darkness, which is silly...

    No idea where to put the check though. As an extra parameter to the TIMED_INC effect probably.

    Old code:
    Code:
    if (!player_resists(context->player, ELEM_DARK))
        {
            int amount = effect_calculate_value(context, FALSE);
    
            player_inc_timed(context->player, TMD_BLIND, amount, TRUE, TRUE);
        }
        wieldeds_notice_element(context->player, ELEM_DARK);
    Need to pass ELEM_DARK somewhere and check vs resistance + notice the element.

    Another little change: the DARKNESS effect was a radius-3 ball doing 10 damage, so the DARKEN_AREA effect should have p2=3 and a dice:10 line.
    Last edited by PowerWyrm; June 12, 2015, 18:42.

    Leave a comment:


  • PowerWyrm
    replied
    More activation changes:
    - "MON_SLOW" was before a "BOLT_AWARE", but is now a "BOLT_STATUS" in activation.txt; same for "POLYMORPH"
    - "SHROOM_PURGING" was curing poison (not mentioned in the description), now it doesn't
    Last edited by PowerWyrm; June 11, 2015, 11:54.

    Leave a comment:


  • PowerWyrm
    replied
    Currently implementing 5cf8776: moving from old to atomic effect, "CURE_NONORLYBIG" lost the ability to cure hallucinations. This is true for both activation.txt and object.txt (!Life).

    Leave a comment:


  • Nick
    replied
    Originally posted by Carnivean
    Bug. It was noted in the beta thread, but I thought Nick had resolved it?
    Yes, I think I have now.

    Leave a comment:


  • Carnivean
    replied
    Originally posted by PowerWyrm
    Feature or bug?
    Bug. It was noted in the beta thread, but I thought Nick had resolved it?

    Leave a comment:


  • PowerWyrm
    replied
    Spell code ported! Now to atomic effects...

    Just looking at the new code, unifying item and spell effects seems to have removed the chance of cancelling item effects when the effect couldn't be applied so that the item wouldn't be wasted. For example, reading a scroll of Rune of Protection would do:

    Code:
    return warding_glyph(player);
    while casting the Rune of Protection spell would do:

    Code:
    warding_glyph(player);
    return TRUE;
    In the first case, returning FALSE would tell the code not to use up the scroll.

    In the new code, the second case is always used. Now items are always used up... Feature or bug?

    Leave a comment:


  • Nick
    replied
    Originally posted by PowerWyrm
    Time to port the new spell code. You can easily imagine the pain with a variant that has TEN spell realms...
    It should make them easier to deal with later though - that's the intent, anyway...

    Leave a comment:


  • PowerWyrm
    replied
    Time to port the new spell code. You can easily imagine the pain with a variant that has TEN spell realms...

    Leave a comment:


  • PowerWyrm
    replied
    Here's a little bug I've found while implementing the gear changes: when you inspect a ring of digging +5 worn on the right hand while having another ring on the left hand, it will say "clears granite in 19 turns"; if you inspect it while having nothing on the left hand, it will say "clears granite in 9 turns".

    This problem arises because the code makes a copy of the object and puts it in the "wield_slot". If the ring is on the right hand, the "wield_slot" becomes the left hand, and so the calculation is made as if the character was wielding two rings, not one.

    The old code was doing a check that was removed during the restructure:

    Code:
        /*
         * Hack -- if we examine a ring that is worn on the right finger,
         * we shouldn't put a copy of it on the left finger before calculating
         * digging skills.
         */
        if (o_ptr != &p_ptr->inventory[INVEN_RIGHT]) inven[sl] = *o_ptr;
    The easiest way to fix the problem is simply to make the copy only if the object is not already equipped.

    Leave a comment:


  • PowerWyrm
    replied
    Changeset 26d9993:

    In do_cmd_knowledge_ego_items(), one line of code has been wrongly deleted:

    Code:
    				/* Ignore duplicate gids */
    				if (j > 0 && gid == default_join[e_count - 1].gid) continue;
    This means that when you find some arrows of Acid, the menu will display three "of Acid" lines (checked with the latest angband-v4.0beta-265-g3a93c47 release).

    Leave a comment:


  • PowerWyrm
    replied
    Originally posted by PowerWyrm
    Just a minor change in gameplay: in 3.5, ego weapons of "Slay Undead" were limited to sval=18 for hafted weapons, which is not the case in 4.0. This means that pointless Maces of Disruption of Slay Undead can be generated.
    This is also true for MoD of *Slay Undead*.

    In the same changeset, sval limit for DSM of Resistance/Elvenkind of 29 was replaced by individual DSMs, including PDSM which sval was 30 and therefore should not be included.

    Leave a comment:


  • PowerWyrm
    replied
    Just a minor change in gameplay: in 3.5, ego weapons of "Slay Undead" were limited to sval=18 for hafted weapons, which is not the case in 4.0. This means that pointless Maces of Disruption of Slay Undead can be generated.

    Leave a comment:


  • Nick
    replied
    Originally posted by PowerWyrm
    At this point, "kind" is already some gold because of the "tval_is_money_k" check. This could be simplified as:

    Code:
    obj = make_gold(player->depth, kind->name);
    Thanks, that was dumb. Good to have you back

    Leave a comment:


  • PowerWyrm
    replied
    Originally posted by PowerWyrm
    At this point, the code combines equipped and non-equipped items (the starting wielded torch and the ones in inventory), doesn't update equipped items properly (equipment shows nothing) and then makes the character wield the scroll of word of recall in the inventory next time it loads from the savefile...

    I'm gonna take a 2-week break (holidays) and I suppose this is gonna be fun to fix all these when I come back (hoping most of this stuff is fixed with the next changesets).
    And my 2-week break is over...

    I've implemented everything up to May 26, 2014 -- which means I'm exactly one year behind. Most gear problems are now fixed and I'm starting to implement the gold changes. Found a little simplification that could be made in place_monster(), line 801:

    Code:
    obj = make_gold(player->depth, lookup_kind(TV_GOLD, kind->sval)->name);
    At this point, "kind" is already some gold because of the "tval_is_money_k" check. This could be simplified as:

    Code:
    obj = make_gold(player->depth, kind->name);

    Leave a comment:


  • PowerWyrm
    replied
    Originally posted by PowerWyrm
    Actually the old code was doing this:

    1) Compute dice power (simply does power for xdy, independently of brands and slays)

    2) Add power once for all objects (to take into account the dice)

    3) Compute an averaged "slay" multiplier: 1 for objects with no slays/brands, something greater than 1 for objects with slays/brands

    4) Add power again for all objects (multiplier * dice power)

    So the dice power was indeed added twice. Was that a bug or not, no idea... But the current code (part 4) now adds 0 for items without brands and 1+x for items with brands. If you don't want to add the power twice for items with slays/brands, you need to substract 1 to the best multiplier when computing the averaged multiplier for slays.
    I was looking at that code again and it's more tricky than I thought. The old code was actually doing this:
    - list all slays/brands, if none, multiplier = 0
    - list all "known" slays/brands, if none, multiplier = 1, if some, multiplier > 1
    - power = dice power + multiplier * dice power

    The new code in slay_power() should then do:

    Code:
        int num = 0;
    
        /* Count the brands and slays */
        while (brands)
        {
            num++;
            brands = brands->next;
        }
        while (slays)
        {
            num++;
            slays = slays->next;
        }
    
        /* If there are no slays or brands return */
        if (num == 0) return p;
    
        /* Count the known brands and slays */
        ...
    
        /* If there are no known slays or brands return */
        if ((num_brands + num_slays + num_kills) == 0) return p + dice_pwr;

    Leave a comment:

Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎
☕