SRL Archive - SRL Suggestions

(Magic.scar) Adding RequiredRunes to TSpell


Coh3n

2010-10-06 20:06:22

Magic has been in the works in MSI for quite some time now, and there are a lot of useful functions in SRL's Magic.scar that we would like to utilize. Since all the attributes of TSpell are set in SetupSpells it's inconvenient for us to use a different type.

Before someone says, "Why should we change SRL just for MSI?". Well, this is only one example, I'm sure we wouldn't be the only ones to use it. It only makes sense to me that along with the Level, Exp, Name, etc., comes the required runes to cast the spell.

const
rune_Count = 12;
rune_Air = 0;
rune_Body = 1;
// And so on...

type
TSpell = record
// Blah blah
RequiredRunes: array[0..RUNE_COUNT - 1] or Integer;
There may be an easier way to do it, that's just what I thought of.

Thoughts?

Gu3st...

2010-10-07 06:22:32

Instead of saying "Why should we change SRL just because of MSI?" I'd like to say "Why should we not change SRL because of MSI?"…
If it's useful for SRL then why not?

I don't see any easier method of doing it

Naike

2010-10-07 09:28:37

Do it?
I really don't see a reason not to do this..

marpis

2010-10-07 16:29:44

No need to even discuss things like these, asking only slows down progress.
If you can't think of why not to do it, then just go for it.

Nava2

2010-10-07 16:31:06

Since no compatibility is broken, and its very small. No need to really ask. Go go go!

Coh3n

2010-10-07 17:34:25

From: marpis
No need to even discuss things like these, asking only slows down progress.
If you can't think of why not to do it, then just go for it.


From: Nava2
Since no compatibility is broken, and its very small. No need to really ask. Go go go!

Good to know. I figured I'd ask just in case. :)

I'll add this to my list of things to do.

NCDS

2010-10-22 23:05:32

Does the amount of each rune required sound like something that should be included in this, or just the types of the runes required?

bolshak25

2010-10-22 23:25:16

id add amount. maybe people can use it to find out how many times they can cast it, or figure exactly how many runes they need to take out to do x casts

Coh3n

2010-10-23 03:38:43

Yes, do number of runes. My original plan was to have an array of Integer, with each index being a run constant. For example:

var
curSpell: TSpell;
begin
curSpell.RequiredRunes[RUNE_AIR] := 5;
curSpell.RequiredRunes[RUNE_MIND] := 1;
end;
It wouldn't be exactly like that, but I'm sure you get the idea.

NCDS

2010-10-23 13:22:45

I was just going to store it all to an array like the other values in Magic.Scar are. I can change it though if that's what you want.

Edit: This is my general idea:

ReqRunes := [[[rune_Air, 1]], {}[[rune_Air, 1], [rune_Mind, 1]], {etc.}];

SetArrayLength(SpellModes[SpellMode_Combat], GetArrayLength(Names));
H := High(Names);
for I:=0 to H do
begin
SpellModes[SpellMode_Combat][I].Name := Names[I];
SpellModes[SpellMode_Combat][I].Level := Levels[I];
SpellModes[SpellMode_Combat][I].Exp := Exps[I];
SpellModes[SpellMode_Combat][I].AutoCast := (not InIntArray(AutoCasts, I));
for ii := 0 to High(ReqRunes[i]) do
begin
SpellModes[SpellMode_Combat][I].RequiredRunes := ReqRunes[i][ii][0];
SpellModes[SpellMode_Combat][I].RequiredRuneAmount := ReqRunes[i][ii][1];
end;
end;
Would require another attribute to the TSpell record, but I think it's worth it.

Coh3n

2010-10-24 23:19:40

How is this going after we talked on MSN?

NCDS

2010-10-30 00:30:32

Didn't get much time today, but tomorrow I'll test what I have so far and see how it work's. If it seems to work well then I'll finish it like this, otherwise I'll switch to the case as you had mentioned.

Edit: http://villavu.com/forum/showthread.php?p=746645#post746645