Simple combat system using attributes

Rockenden
Is there some way to compare attributes in terms of less than, greater than, and equal to?

I'm trying to implement a very simple combat system.

Cheers,

Jim



var randomnumber = function rng(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}

set ("Monsterhit", randomnumber(1,6));

The monster atttacks with {Monsterhit}

[[strike back]](PCtohit)

[[PCtohit]]:
var randomnumber = function rng(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}

set ("PChit", randomnumber(1,6));

You counter with {PChit}

[[result]](result)

[[result]]:

{if PChit > Monsterhit: You strike the monster}
{if PChit < Monsterhit: The monster strkes you}
{if PChit == Mosterhit: This round is a draw}

Rockenden
I've realised that I have to do the less than/greater than in javascript but I'm still not getting any output...
    
var randomnumber = function rng(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}

set ("Monsterhit", randomnumber(1,6));

The rat atttacks with {Monsterhit}

[[strike back]](PCtohit)

[[PCtohit]]:
var randomnumber = function rng(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}

set ("PChit", randomnumber(1,6));

You counter with {PChit}

[[result]](result)

[[result]]:


if (PChit > Monsterhit)
{
set("PCwin", "1");
}

if (PChit < Monsterhit)
{
set("Monsterwin", "1");
}

if (PChit == Monsterhit)
{
set("Draw", "1");
}

{if PCwin=1: You strike the monster}
{if Monsterwin=1: Monsterhit:The monster strkes you}
{if Draw=1: This round is a draw}

Rockenden
Ach!
Got it. I needed to get the squiffy values.


var javaPChit = get("PChit");
var javaMonsterhit = get("Monsterhit");


This topic is now closed. Topics are closed after 180 days of inactivity.

Support

Forums