ID:2040142
Feb 19 2016, 5:45 pm (Edited on Jul 21 2016, 11:01 pm)
|
|
Man undo. Feed me material.
|
*1 HasMana is a procedure (previously defined) Its parameters include the Spellsz 'manaCost'; the owner is assigned to the verbsz user?
Notice how I defined the variable "owner" on line 2 of the code snippet. It is defined under /Spell, meaning that all sub-types of it (eg. /Spell/Firestorm) will also have it. I suppose you'd assign it in /Spell/New() or somewhere similar. *3 I noticed you subtracted 'manaCost' using the AddMana procedure? (Your AddMana procedure operates by returning the specific spellsz manaCost) How? Sorry, the proc name was misleading. Let's rename it, "ChangeMana". The idea is that, instead of simply doing "owner.mana -= manaCost", you could put some juicy complexity into that by doing the following: mob/proc/ChangeMana(var/amount) Notice how by creating a proc like this, it's easy to start adding effects and modifiers. This is a bit of a crude example, but you get the idea. *4 The for loop checks all the turf within a fixed range from the 'owner' We could influence by skill level & strength of spell? Just make them variables, and replace them in the proc! Variables are your friend. //*6 They TakeDamage by owner, however much damage the procedure has calculated, what 'fire' was intended to do? I do not know? Maybe you want different "damage types" to deal more or less damage to enemies. In games like Diablo, players have elemental resistances; this way, if a party of players know they are going to fight, say, Fire monsters in the next dungeon, they can prepare themselves by acquiring gear that gives them extra Fire resistance. I could write more pseudo code here, just to illustrate: // Imagine the following variables are a number between 0 and 1, e.g. 0.45 I couldn't quite understand your other questions, sorry! |
In response to Delta0Zero2
|
|
Delta0Zero2 wrote:
Thanks. Bye! |
In response to Gunbuddy13
|
|
Gunbuddy13 wrote:
You probably just did this guys homework. I got a more pornographic vibe, but yeah. That's a theory. |
In response to Gunbuddy13
|
|
Gunbuddy13 wrote:
You probably just did this guys homework. WEEEEEEW Gravedigger |
Why not. Jeez.
"casting a firestorm that incinerates mobs and burns turf "
I have done a few things here slightly differently from what you would expect, and they have been on purpose. Feel free to ask.