r/DvZ•
FusionBlock

Hero Nisovin Usability Suggestion

In terms of the wand, the current spell casting system has been a bit wonky with the scrolling through the spells, so here is a possible rework for that.

Perhaps when you use the wand, your hotbar changes to the selection of the spell. Using the wand could either be sneaking with it or right clicking it. The source code is for the former, sneaking while holding the wand brings up the spell selection, and releasing shift casts the current spell you are hovering over and then returns your regular bar. If no spell is selected, your regular hotbar is returned without casting anything.

4 variables, remember to instantiate:

Player nis; //instance of whoever is playing nisovin

ItemStack[] hotbar; //length: 9, nisovin's hotbar; set when sneaking

ItemStack[] spellbar; //length: 9, the hotbar preset for spell selection

boolean prevSneak; //?nisovin sneaking last tick

Methods: run() called every tick

public void run(){

    //we are detecting changes only, so sneak -> no sneak, or no sneak -> sneak

    if(holdingWand()&&nis.isSneaking()&&(!prevSneak)){ //change holdingWand() to whatever used to detect such

            //1st tick they are sneaking: change the hotbar to spells

            setSpellBar();

    }else if(holdingWand()&&(!nis.isSneaking)&&prevSneak){

        //just released sneak: activate selected spell and return to regular bar

        switch(nis.getItemInHand().getItemMeta().getDisplayName()){

        //assuming item name = spell, can use other identification method

            case "Tinder Flame":

                //cast tinderflame

                break;

            //repeat for other spells

            default:

                //do nothing as no spell is selected

                break;

        }

        setRegBar();

    }

    prevSneak = nis.isSneaking(); //set for the next tick

}

private void setSpellBar(){

    PlayerInventory inv = nis.getInventory();

    for(int i = 0; i < 9; i++){

        //save the bar under hotbar

        hotbar[i] = inv.getItem(i); //player inv: hotbar = {0-8} how convenient :)

        //set the item to corresponding in spellbar

        inv.setItem(i, spellbar[i]);

    }

}

private void setRegBar(){

    PlayerInventory inv = nis.getInventory();

    for(int i = 0; i < 9; i++){

        //return the bar

        inv.setItem(i, hotbar[i]);

        //remove hotbar holder (storage space, dont need to though)

        hotbar[i] = null;

    }

}

If it conflicts with the rocket boots (whatever it's called), that ability can just be changed to activating only on the primary weapon.

Edit: Fixed the format

Posted Jan 28, 2016, 10:41 PM UTC · edited

511
Doom_BringerMCDoom•

If I'm understanding this correctly, it seems like it would make spell casting much slower and clunkier, which isn't ideal in a game that uses a lot of reactionary functions.

4
FusionBlockOP•

The current casting system runs off of memory, so its clunky to change between them. Of course, my selection method can be to set the spell and not cast it.

1
Doom_BringerMCDoom•

I don't have any issues switching between them right now. Being able to just Click X times to get the spell I need, cast, hit it a few more times and cast again is quite efficient as is. Having to stop, hover over the right spell to set, then being able to cast only to do it again for each spell change doesn't seem great. Especially if it's bound to Shift which would mean you couldn't do it while running.

 

Edit: Maybe if it worked off of Hot Keys it would be better, so you could hold R-Click and hit 1, 2, 3 or 4 for each spell respectively. But having to hover your mouse over each spell, each time you need to change spells doesn't seem more efficient.

1
Rurikar•

In terms of important things to rework, heroes are at the bottom of the list. The heroes have more or less been the same for over two years now and it takes a lot of time to rebuild and balance them.

4
FusionBlockOP•

Uhh the format messed up a bit. Give time for me to edit it. (Sorry I'm a noob with reddit) Edit: done

1
_Tomb_Maker_Tomb_Maker•

I don't see what's wrong with the current set up

1
OverhighlordOgregr•

It can be pretty inefficient and not very user friendly but I guess once you memorise the order it can be pretty easy to use, especially considering how you can scroll through 2 at once by clicking on a block with it. Whilst OP's solution is a bit confusing to read, I think that it could possibly work.

2
Yeldarb10Gravedigger•

Scroll through 2 at once by clicking on a block

SO THATS WHY IT KEPT SKIPPING EXPLOSION!

1
DrLolzworth•

Wait.. It is in an order? All this time I had no idea and thought it was random. I should have been kicked out of wizard school decades ago!

1
Imhotep0Jimmy•

Ewww you use a {

}

style instead of a

{

}

style :( It makes it look much uglier imo :p

1
Clefstarhttp://www.twitch.tv/banistarcarello/•

I prefer the

if() { place code here }

style ;)

(just to mess with you)

1