HarryPotterSpells

Discussion in 'Plugin Development' started by kezz101, Aug 4, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    evilmidget38

    I haven't actually started on it yet, but what I'll be doing is this:
    1. Create a SpellDescriptionFile, similar to a PluginDescriptionFile. This allows me to collect the correct path in order to load the correct file. Although I'm not sure what exactly I'll be
    2. Since you've already created an abstract spell class, and a spellmanager, I'll hook into those.
    3. Create a SpellLoader, which uses the main, reflection, and some file loading to create a new instance of said spell. Depending on how exactly spells are working currently, a new instance may not be necessary(due to them currently being cast via a static method).
    4. Anything else I forgot to mention here. I'll put it all in a new package, and modify NOTHING outside of said package, that way it doesn't conflict with any other edits.

    I'm also considering re-writing the command structure, as currently, it's pretty sad. The possibilities allowed by commands are minimal.
     
  2. Offline

    korikisulda

    I agree with pretty much everything you've said ;) actually, for custom spells, you can just write an interpreter class that extends Spell and add it via the spellmanager, although I might have to change a few things around so spells names aren't dependent on the class name.

    And you need instances, there aren't any statics left ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  3. Offline

    izak12345678910

    Conversation on where?
     
  4. Offline

    np98765

    Why, on here. :p PM's are called Conversations.
     
  5. Offline

    izak12345678910

    Oh thought you meant Skype :p
     
  6. Offline

    evilmidget38

    Alright, good to know, I just looked at the code. I'm just about done with it,

    EDIT: I've made an appropriate pull request.
    np98765
    korikisulda
    kezz101
     
  7. Offline

    pyraetos

    Moved to more fitting forum.
     
  8. Offline

    RingOfStorms

    Mob targeting it seems like.
     
  9. Offline

    kezz101

    Hmmm... I'll check it out after I've come back from my holiday... Oh I've also added you as a contributor :)
     
  10. Offline

    evilmidget38

  11. Offline

    RingOfStorms

    kezz101 when you get the x,y,z of the block are those the exact center of the block, or a corner of a block?

    BTW gonna give you a heads up so you can fix it, you can use spells through walls. Hint: Check to see if the current block in the iterator is = to air (or make a whitelist so you can go through glass or whatever.) or not.
     
  12. Offline

    kezz101

    Sure!

    I'm not sure about the first part... When getting a target block I use the getTargetBlock() (i think). I've made an issue about the spells through walls.
     
  13. Offline

    RingOfStorms

    kezz101 yea so the x,y,z is the center. So when you do the .75 and the 1.5 it doesn't make sense because you're going uneven. Also, on the y axis, up is down, down is up. That may help you out.
    cV is a constant between all of them to make sure you're area of checking is symmetrical and not weird shaped. Pay attention o the y-axis!
    Code:
    if ((bx-cV <= ex && ex <= bx+cV) && (bz-cV <= ez && ez <= bz+cV) && (by-1.5 <= ey && ey <= by+.1)) {
    
    I've figured out how to make a whitelist of blocks with configs and check it and such but I think you can do that one ^_^. You can add in things like grass and wheat or whatever and those blocks would be ignored when casting.
     
  14. Offline

    kezz101

    Ahh that makes sense... :D I'm working on that now... But feel free to make a pull request if you want! They're always much appreciated!
     
  15. Offline

    RingOfStorms

    Oh one last hint that I've done on mine and works very well, and in a switch/if/else tree to modify your y-axis. If you keep it at 2.5 all the time then you can really easily hit things like wolfs from like 3 blocks above it. That doesn't make too much sense now does it. This is what I did, I made a variable cY and put it inplace of the 1.5 above and used this function to get it.

    Code:
    private static float getYMod (Entity e) {
    float y;
            if(e instanceof Enderman) {
          y = 2.1f;
            }else if(e instanceof Cow || e instanceof Pig || e instanceof Sheep || e instanceof MushroomCow || e instanceof MagmaCube || e instanceof Slime) {
          y = 1.1f;
            }else if(e instanceof Ocelot || e instanceof Wolf || e instanceof Chicken || e instanceof CaveSpider || e instanceof Spider ||  e instanceof Silverfish || e instanceof Squid){
          y = 0.1f;
            }else if(e instanceof Player || e instanceof Skeleton || e instanceof Creeper || e instanceof Zombie || e instanceof PigZombie ||e instanceof Snowman ||  e instanceof Villager || e instanceof Blaze) {
          y = 1.1f;
            }else{
          y = 1.0f;
            }
         
            return y;
    }
    
    kezz101
    Ok that's my last help for you ^_^ I don't want your plugin to be too much better than mine now do I :p
     
  16. Offline

    kezz101

  17. Offline

    Milkywayz

    If your looking for any cooldowns / delays for spells and such, I released a library which makes that a lot easier. Also if you are still looking for help I could make a few contributions maybe.
     
  18. Offline

    JjPwN1

    Milkywayz
    I, myself, am interested in your library for cooldowns. It would be very useful for a plugin I am making. Where can I find it?
     
  19. Offline

    Milkywayz

    :) Here Im making writing some more it right now too. Basically the current version only allows cool downs if theres a player name, Im adding GeneralCooldowns (Also organizing the code ALOT better).
     
  20. Offline

    evilmidget38

    Has it been confirmed that spells successfully work on entities?
     
  21. Offline

    np98765

    Where they ever not working on entities? :confused: In all my tests, they worked, except for the dysfunctional ones which I need to fix (Avada Kedavra and Episkey).
     
  22. Offline

    evilmidget38

    I did some changes and am testing things, just curious if I might have broke things. Has casting spells on chickens been tested?
     
  23. Offline

    np98765

    No, I've only tested on cows and sheep (and players) so far... Is chicken targeting not working?
     
  24. Offline

    evilmidget38

    I made slight changes to the targetting system, I'm going to look over my changes some more before I have anything to report. I was just making sure that I wasn't looking over my code for an issue that's not mine.
     
  25. Offline

    RingOfStorms

    kezz101 I will do a pull request and add in modifications to the targeter to make it better. So if anyone else has been changing git look back on it in a bit, I'll edit this post when I finish

    Edit: Ok I submitted the pull request for the targeter, it will be a bit more accurate and send messages for the testing stages.
    evilmidget38
    np98765

    If you guys want me to add in the white list block thing so that you can't cast through walls I will do that. But only if you want me to. It will allow you to setup a white list of blocks that can be casted through, like grass blocks or whatever, and anything else like stone, cannot be casted through and will return the null target.
     
  26. Offline

    np98765

    That sounds good to me. :) Some people might want the ability to cast through something like glass/glasspanes.
     
  27. Offline

    evilmidget38

    Assuming it's been tested, I'll base my changes to the spells(optimizations galore, general improvements) on what you've done.

    EDIT: I didn't finish my message.
     
  28. Offline

    RingOfStorms

    np98765
    evilmidget38

    Yea all my changes that I am helping you guys with work (I've tested it on my stuff). I have them in my targeter for a plugin I am working on. And if I add in the whitelist feature I am not going to add it to the config or anything. I'll simply make the array above it and then you guys can replace it later on with an array from a config or whatever.
     
  29. Offline

    zachoooo

    I would love to help by adding spells, but I could just stick to pull requests if you didnt want to add me as a contributor
     
  30. Offline

    kezz101

    Thatd be brilliant!

    Well I'm off now or a two week camping holiday! Have fun guys :) I'll still be able to sed/receive messages here albeit at a slower delay...
    RingOfStorms
    evilmidget38
    @korkisulda
    np98765
     
Thread Status:
Not open for further replies.

Share This Page