Page 9 of 10 FirstFirst ... 7 8 9 10 LastLast
Results 81 to 90 of 96

Thread: Spring 2020 Challenge Path - Path of the Plumber

  1. #81
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,541

    Default

    Showing the code was why I was trying to make a simple example.
    Code:
                            return useSkill($skill[[7336]Multi-Bounce]);
    Code:
    string useSkill(skill sk, boolean mark)
    {
            if(mark)
                    markAsUsed(sk);
    
            return "skill " + sk;
    }
    
    string useSkill(skill sk)
    {
            return useSkill(sk, true);
    }
    I checked this string and it was indead "skill [7336]Multi-Bounce".

    EDIT:

    The full code (without my modifications) can be found here: https://github.com/Loathing-Associat...uto_combat.ash
    Last edited by Crowther; 03-15-2020 at 09:22 PM.

  2. #82
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    Code:
            return "skill " + sk;
    That is the line that matters. "sk" is a skill object, so you are doing to_string() on a skill.

    Yeah, ambiguous items, effect, monsters, and skills now have their ID as part of the string representation.

    I'll add proxy fields to those 4 data types so you can use sk.base_name, say.

    Edit: make that .name - which we already have for items.
    Last edited by Veracity; 03-15-2020 at 09:16 PM.

  3. #83
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    Right.

    Code:
    > ash to_item( 7962 ).to_string()
    
    Returned: [7962]Eye of Ed
    
    > ash to_item( 7962 ).name
    
    Returned: Eye of Ed
    
    > ash to_effect( 597 ).to_string()
    
    Returned: [597]A Little Bit Evil
    
    > ash to_effect( 597 ).name
    
    Returned: A Little Bit Evil
    
    > ash to_monster( 2172 ).to_string()
    
    Returned: [2172]Bowser
    
    > ash to_monster( 2172 ).name
    
    Returned: Bowser
    
    > ash to_skill( 7336 ).to_string()
    
    Returned: [7336]Multi-Bounce
    
    > ash to_skill( 7336 ).name
    
    Returned: Multi-Bounce
    Revision 19861

  4. #84
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    By the way - it's OK to not disambiguate skills in CCS or combat filter actions. Both of those look up only Combat skills - and that set contains no ambiguity.
    One hopes that KoL will not add any.

  5. #85
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,541

    Default

    By the way - it's OK to not disambiguate skills in CCS or combat filter actions. Both of those look up only Combat skills - and that set contains no ambiguity.
    One hopes that KoL will not add any.
    Originally Posted by Veracity View Post
    Ah thanks, I was worried that would be a problem.

  6. #86
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,541

    Default

    Okay, took a while to get there, but yes, adding .name to avoid an automatic skill to string conversion fixed the issue. Thanks, again.

  7. #87
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    1) Maximum number of plumberPoints
    Originally Posted by Veracity View Post
    We'll learn this soon enough, I expect. I won't be the one who discovers it; I am slow and have spent extra time in aftercore, so I only have 14.

    2) I'd like to optimize HP restoration a bit.

    We try to use mushrooms on hand first, and then buy mushrooms with coins. I'm happy with that, but when using mushrooms on hand, it uses them in order super deluxe mushroom, deluxe mushroom, mushroom. I'd like it to take how much restoration you need. E.g., if you need 40, use a deluxe mushroom and a mushroom, rather than a super deluxe mushroom. Similarly, if you don't have mushrooms, it should buy those two mushrooms. It already takes "efficiency" into account - one super deluxe mushroom is more "efficient" at healing 35 than 2 deluxe mushrooms or 4 mushrooms, but it won't look at combos. For 35, 1 deluxe mushroom and 1 mushroom will do it for fewer coins.

    This is probably more work than is worth it, considering that by the time I'm doing "restore HP", I have plenty of coins.

    I'll probably move plumber restoration into a new method, which can be tinkered with as desired.
    Yeah, I refactored RecoveryManager.restore and put Plumber restoration (HP only) into RecoveryManager.plumberHPRecovery. As coded, it always tries to use mushrooms in inventory first and then moves to buying them, which leads to suboptimal things like using a deluxe mushroom to heal 30 of 90 needed, and then buying and using a super deluxe to cure the last 60.

    Now, if you don't have enough coins to buy, restoring some is better than none, but it seems like we could look at desired recovery, mushrooms in inventory, and available coins, and come up with an optium combination of inventory + purchase to get the desired healing - or as close to it as possible.

    That's not easy. Pondering.

    I also intend:

    3) Allow HP restoration before the Tower's hedge maze. I disabled that back before I added HP restoration for Plumbers.

    That's easy, but we may or may not get #1 and #2 before I make a new point release this month. Current Plumber support is good enough for that, even if we can improve it later.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  8. #88
    Junior Member
    Join Date
    Jun 2015
    Posts
    26

    Default

    Max plumbercoins is 1100

  9. #89
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    Thanks. Revision 19919.

  10. #90
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,937

    Default

    Revision 19920 adds an HP recovery algorithm for Plumbers which attempts to optimize item usage such that it doesn't do follish things with mushrooms you already have in inventory.

Posting Permissions

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