Slowdive's Little Daily Blog

Discuss anything in general about the IceBlink Engine + Toolset project (or anything else) here.
Post Reply
User avatar
slowdive
Site Admin
Posts: 510
Joined: Wed Jan 15, 2020 4:37 am

Re: Slowdive's Little Daily Blog

Post by slowdive »

I created the two traits and finished implementing the system. I just need to go through each weapon and flag the ones that are "light" weapons.

In the images below you can see that the ranger has the trait, but since the off-hand item hasn't been changed to be a light weapon yet, it still shows -4/-4 instead of -2/-2... I'll fix that next.
OffHand02.PNG
OffHand02.PNG (148.58 KiB) Viewed 7922 times
OffHand03.PNG
OffHand03.PNG (126.63 KiB) Viewed 7922 times
User avatar
slowdive
Site Admin
Posts: 510
Joined: Wed Jan 15, 2020 4:37 am

Re: Slowdive's Little Daily Blog

Post by slowdive »

Finished adding the "light" weapon flag to all light weapons. In the item description, it now shows "Light Weapon: yes/no" as seen in the image below. Also, the correct attack modifier is calculated due to the light weapon.
OffHand04.PNG
OffHand04.PNG (148.59 KiB) Viewed 7921 times
User avatar
Dorateen
Posts: 321
Joined: Thu Jan 16, 2020 3:03 pm

Re: Slowdive's Little Daily Blog

Post by Dorateen »

That is wonderful. Another mechanic I think has been missing from IceBlink is critical hits. It doesn't have to be an elaborate system, could be just double damage on a roll of a natural 20. But something like that can dramatically change the feel of combat.
User avatar
slowdive
Site Admin
Posts: 510
Joined: Wed Jan 15, 2020 4:37 am

Re: Slowdive's Little Daily Blog

Post by slowdive »

I added the mechanics for critical hits as suggested by Dorateen. It basically works like d20, or is close. A 20 always hits, but does not automatically result in a critical hit. If the threat range is exceeded, then another roll is made with the same bonuses to see if you make the critical hit (another 20 or threat range is not needed for this roll). The critical hit damage uses the item's or creature's CriticalMultiplier value which could be x2 or x3.

Here is the important code for PCs (for Creatures is similar):

Code: Select all

            int attackRoll = gv.sf.RandInt(20);
            int attackMod = CalcPcAttackModifier(pc, crt, isMainHand);
            int attack = attackRoll + attackMod;
            int defense = CalcCreatureDefense(pc, crt);
            int damage = CalcPcDamageToCreature(pc, crt, isMainHand);
            bool criticalHit = false;
            int critAttackRoll = gv.sf.RandInt(20);
            int threatRange = 20;
            
            Item itChk = gv.cc.getItemByResRefForInfo(pc.MainHandRefs.resref);
            if (!isMainHand)
            {
                itChk = gv.cc.getItemByResRefForInfo(pc.OffHandRefs.resref);
            }
            if (itChk != null)
            {
                threatRange = itChk.threatRange;                
            }
            
            if (attackRoll >= threatRange)
            {
                //determine if a critical hit is applied
                if (critAttackRoll + attackMod >= defense)
                {
                    criticalHit = true;
                    damage *= itChk.criticalMultiplier;
                }
            }

            bool automaticallyHits = false;            
            if (itChk != null)
            {
                automaticallyHits = itChk.automaticallyHitsTarget;
            }
            //natural 20 always hits
            if ((attack >= defense) || (attackRoll == 20) || (automaticallyHits == true)) //HIT
            {
                crt.hp = crt.hp - damage;
                gv.cc.addLogText("<bu>" + pc.name + "</bu><br>");
                gv.cc.addLogText("<wh>attacks </wh><br>");
                gv.cc.addLogText("<gy>" + crt.cr_name + "</gy><br>");
                if (criticalHit)
                {
                    gv.cc.addLogText("<gn>CRITICAL HIT (-" + damage + "hp)</gn><br>");
                    gv.cc.addLogText("<wh>ATT: " + attackRoll + "+" + attackMod + ">=" + defense + "</wh><BR>");
                    gv.cc.addLogText("<wh>CRIT: " + critAttackRoll + "+" + attackMod + ">=" + defense + "</wh><BR>");
                }
                else
                {
                    gv.cc.addLogText("<gn>HITS (-" + damage + "hp)</gn><br>");
                    gv.cc.addLogText("<wh>" + attackRoll + "+" + attackMod + ">=" + defense + "</wh><BR>");
                }  
User avatar
Dorateen
Posts: 321
Joined: Thu Jan 16, 2020 3:03 pm

Re: Slowdive's Little Daily Blog

Post by Dorateen »

Wow, I did not expect the full system of threat range and varying crit multipliers. Amazing!
User avatar
slowdive
Site Admin
Posts: 510
Joined: Wed Jan 15, 2020 4:37 am

Re: Slowdive's Little Daily Blog

Post by slowdive »

Dorateen wrote: Thu Jan 21, 2021 2:50 pm Wow, I did not expect the full system of threat range and varying crit multipliers. Amazing!
Thanks Dorateen! Today I fixed a couple of bugs with the two new systems after testing. I also added more feedback in the combat log about attack rolls and critical rolls. I updated all weapons in the new IBbasic Jr. data editor to add threat ranges and critical multipliers (used the values from the d20 SRD). Next up I will create a trait for "improved critical" that will double the threat range. I will also add a trait for "two-weapon defense" that will add a +1 AC bonus when using a weapon in the off-hand and maybe a L2 as well that uses a +2 AC bonus.

So who should have access to these traits and at what level do you suggest?
two-weapon fighting L1
two-weapon fighting L2
improved critical
two-weapon defense L1
two-weapon defense L2
User avatar
Dorateen
Posts: 321
Joined: Thu Jan 16, 2020 3:03 pm

Re: Slowdive's Little Daily Blog

Post by Dorateen »

slowdive wrote: Fri Jan 22, 2021 4:50 am

So who should have access to these traits and at what level do you suggest?
two-weapon fighting L1
two-weapon fighting L2
improved critical
two-weapon defense L1
two-weapon defense L2
Presently in IceBlink we have the Two Attack trait available for Fighters at 4th level. I think that would be a good place for the Two Weapon Fighting trait, so players have a choice to build a character who attacks twice with one weapon, or attacks with two weapons. Then maybe add the L2 version at Level 6.

Since two weapon fighting is often associated with rogue or ranger builds, perhaps make the traits available for those classes at Level 2 and 4, respectively.

Improved Critical could be pretty powerful, how about an odd level like 5. Would make available for Fighters, Rangers, Paladin and Thief classes.

I would probably put the Two weapon defense traits on odd levels, maybe 3 and 5. I don't see these traits being abaillable for wizards or clerics.

But this is all dependent on a module builder and the scope of their project. The traits available and at what level can always be adjusted in the toolset. The above is just some thoughts as a starting point.
User avatar
slowdive
Site Admin
Posts: 510
Joined: Wed Jan 15, 2020 4:37 am

Re: Slowdive's Little Daily Blog

Post by slowdive »

Thanks Dorateen, I'll use those as the default values and of course builders can modify them as needed.

Today I implemented the two-weapon defense traits and the improved critical trait. I also add more text info on the character screen, party inventory screen, and item selector screen to show the threat range and critical multiplier of a weapon.
OffHand06.PNG
OffHand06.PNG (149.72 KiB) Viewed 7888 times
OffHand05.PNG
OffHand05.PNG (94.41 KiB) Viewed 7888 times
User avatar
slowdive
Site Admin
Posts: 510
Joined: Wed Jan 15, 2020 4:37 am

Re: Slowdive's Little Daily Blog

Post by slowdive »

I added a new trait called "Bandage". It is available to all Player Classes at level 1 and is automatically learned. It is an active trait and it uses up your turn. You need to be adjacent to a PC in order to use it. If a PC falls below 0 HP and starts bleeding, you will want to use this trait to bring them back to 0 HP so they don't die. I think it will work out okay, but I'll have to wait and see if it is too powerful of a feature/trait. Maybe it should be available to only some classes or it has to be learned so that players have to make a choice on selecting this trait or others. I haven't implemented it for outside combat use just yet.
User avatar
slowdive
Site Admin
Posts: 510
Joined: Wed Jan 15, 2020 4:37 am

Re: Slowdive's Little Daily Blog

Post by slowdive »

The past few days I have been working on the Xamarin version of IBbasic Jr. Xamarin has evolved a bit since I worked on IBbasic last so some changes had to be made. It looks like the future is in .net standard so it automatically put me in that direction when creating a new project. The project is structured differently than it was when I was doing a "shared" project. So far I have the UWP and android versions working. I still need to add all the changes that I have implemented with the PC version as posted above. I will need to renew my Apple dev account and pay the annual fee before I can get the iOS version running. I briefly looked at maybe moving IBbasic to Unity, but I think I will stick with Xamarin for now.
Post Reply