Coding

All things computer programming related...

Warlock subclass

- Posted in Coding by

The warlock receives his pact blade upon first entering the Warlock class. This blade counts as a +3 weapon solely for the purpose of making touch and ranged touch attacks.

The party boon a warlock confers upon companions is that they receive 1 HP every time the warlock's pact blade inflicts damage.

The personal boon a warlock begins enjoying at Warlock 3: when your pact blade inflicts damage, you receive half the amount (rounded down) as restored Hit Points. If HP are already at maximum, instead gain these as temporary HP.

Regardless of whether the warlock is wielding the pact blade, whenever the warlock is struck in melee combat, the pact blade magically inflicts X damage on the attacker, where X is equal to the Warlock's total caster levels — as long as the pact blade is worn upon the warlock's person or carried in a pouch or backpack.

Area effect spells that include the warlock as one of multiple targets do not provoke this pact blade response, but spells targeted directly on the warlock do, as do ranged and melee attacks targeting the warlock.

At Warlock 2, the Warlock gains resistance to a damage type of his choice from the following list: radiant, necrotic, puncturing, slashing, bludgeoning, fire, cold, electricity, acid, and force.

At Warlock 4, the Warlock gains resistance to another damage type, not previously selected, from the foregoing list.

At the 5th and final level of Warlock, the warlock gains a permanent boon from its patron. Examples of such boons are the following at-will or automatic effects: regeneration 3, assume gaseous form, dispel magic 15' radius (as if cast by the warlock's patron), an AC improvement of 3, the ability to fly, or petrification. At Warlock 10, the warlock gains another boon from its patron, or increases the potency of an existing boon.

Warlocks may sacrifice prepared spells from other classes' spell lists to power their warlock spells.

Some patrons bestow lesser and or greater boons upon their warlocks at Warlock 1.

Monk sub-class

- Posted in Coding by

Prime ability: Dexterity & Wisdom; the Monk subclass cannot wear armor, as the monk requires freedom of movement.

◦◦◦

Party Boon at Monk 1: Once per long rest, a Monk can expend ki to rid herself and party members of fatigue and restore 2 HP to herself and up to {Monk level} allies. At Monk 3, she can instead do this once per short rest and restores 5 HP. At Monk 5 the restored HP rises to 10.

Personal Boon at Monk 3: At Monk 3, the Monk is never caught flat-footed, even when surprised. The monk can also reduce the number of 1d6's rolled for fall damage by their level in the monk class (and are still able to make a dexterity save for half damage on any remaining 1d6's to be rolled).

Monks can make a DC 13 saving throw to reduce falling damage or area effect damage by half upon success. If non-monk characters already get a saving throw for half-damage, then the monk suffers no damage on a successful save and half-damage on a failed save.

Because of their discipline, monks also may add their Wisdom modifier on saves against mind-influencing effects.

A monk's base armor class is 9, modified by Dexterity and Wisdom modifiers. For every two full levels in Monk up to and including Monk 10, this AC improves another step. Monks may wear magical rings and bracers, but cannot fight in armor. A monk applies her Monk level to saving throws against natural and magical diseases.

The Monk subclass gives access to the Flurry of Blows Heroic Deed.

NAudio playing mp3 files

- Posted in Coding by

If you're going to play songs, you wanna use .mp3 format. That's not quite as simple. After some research, I found it's not difficult if you use a freely available library called NAudio. Your code must reference this library, whose code is contained in file NAudio.dll

Your code must reference this library, whose code is contained in file NAudio.dll (downloadable here). I should note that the following code will suffice equally well whether you wish to play .wav or .mp3 files.

<script src="https://gist.github.com/kyrathasoft/607c71059fc608224279c3da5ddabfc2.js"></script>

Autoscroll webpage

- Posted in Coding by

Today, I changed the font face of blog posts to Lato, and the color from black to a dark gray (i.e., #494949). I'm using the clean theme with HTMLy. The style.css file is located in /themes/clean/

I'm wanting to learn coding skills so that I can create games that run in people's browsers and that may use some connectivity to a website. I'm not even really sure where to start, so I'm just reading some articles -- here's one; here's another.

I have a player in my mythweaver game that has some javascript background, so I'm gonna pick his brain. We'll see where it leads...

Also, the echoed output from my count_entries.php webpage is lengthy. I found a solution to make it auto-scroll to the bottom of the page after a one second delay.

I also found a javascript solution to scroll the above page to the bottom automatically, so that I see the summary data at the end of the page:

<script>
    function autoScrolling() {   
    window.scrollTo(0,document.body.scrollHeight); }         
    setInterval(autoScrolling, 1000);
</script>

Placing the above javascript inside the tags of a webpage will cause the page to scroll to the bottom one second after loading.

Capture console output in C#

- Posted in Coding by

The following C# source code demonstrates how to capture the output of a console program:

Unresolved assembly reference

- Posted in Coding by

Sometimes you'll get “Unresolved assembly reference not allowed” when attempting to use ILMerge. To avoid this, specify the full path to the framework you're targeting, like this:

ilmerge /targetplatform:v4,"C:WindowsMicrosoft.NETFramework64v4.0.30319" /out:merged.exe myprogram.exe mylib1.dll mylib2.dll

ZipFolder

- Posted in Coding by

using ZipFolder from the Windows command-line

ZipFolder is a nifty little Windows command-line utility that is passed two arguments: (1) the folder that is to be compressed into a .zip archive, and (2) the name of the resulting archive (with .zip extension)

Note: this utility requires that you have installed the .NET Framework 3.5 but Windows should prompt you to install it, if it is missing.

The usefulness of this CLI utility lies in the fact that we can leverage it from programming code. Aside from that scenario, most Windows users won't find much reason to use it.

↓ZipFolder

Code Obfuscators

- Posted in Coding by

Although it's probably the case that the hobbyist developer needn't worry too much about his .NET CIL code being decompiled, there are some free assembly obfuscators that seem to work: OrangeHeap (~ 1.35 Mb download) and Confuser (~2.2 Mb download; available here). I prefer the latter.

Tools like these have a way of becoming vaporware. Nevertheless, at the time I write this, you can find OrangeHeap here on the internet, and Confuser here.

Roll dice

- Posted in Coding by

Sometimes you just want to use a simple online dice roller; at other times, you want to roll one yourself using your favorite programming language.

It can be useful to generate random numbers using C#. Here is a zipped Visual Studio Community 2022 project demonstrating rolling d6 dice. And below, I've inlined the Github gist of the class I'm using.

Website encapsulation into an executable

- Posted in Coding by

There are a couple of different ways (that I know about) to encapsulate a website (or just a subdirectory?) into an executable. There is Web2Executable and Nativefier via nodejs.

I'm basically only noting these here on the chance that someday I may do actual work with Squiffy or Twine.

I've cached a copy of Web2Executable on my Box.com account and here on my pcloud account.

Page 7 of 11