Combining squiffy 'rotate/sequence' and if statements

Rockenden
I'm using the squiffy rotate function as it seems to be an efficient way to do what I want which is a basic character sheet before starting the story.
I want to assign an amount of hitpoints and a special skill depending on which Class is chosen
What seems to be happening is that the if statements are not filtering and the last attribute displayed is the last one read.

Bit stumped by this. Any help gratefully received.
Cheers,


@title DaramainsTower
<p style="font-size:33px; color:red;"> Character Creation</p>
<hr><br><br><br>


Click the links below in order to create your character. <br>

[Enter First Name] <br>
[Enter Last Name] <br>
Click to select: {rotate gender:Male:Female} <br>
Click to select: {rotate race:Human:Elf:Dwarf:Halfling} <br>
Click to select: {rotate Class:Fighter:Mage:Thief:Cleric} <br>


[Enter First Name]:

var name1 = prompt("Please enter your First name", "");
set ("firstname", name1);

[Enter Last Name]:

var name2 = prompt("Please enter your Last name", "");
set ("lastname", name2);


+++continue...

if (Class = "Fighter") {
set ("hitpoints", "10");
set("skill", "Intimidate");
}


if (Class = "Mage")
{
set ("hitpoints", "4");
set("skill", "Fireball");
}

if (Class = "Thief")
{
set ("hitpoints", "6");
set("skill", "Sneak");
}

if (Class = "Cleric")
{
set ("hitpoints", "8");
set("skill", "Heal");
}


if (gender = "Male")
{
set("Boy/Girl", "Boy");
set("boy/girl", "boy");
set("Man/Woman", "Man");
set("man/woman", "man");
set("Sir/madam", "Sir");
set("sir/madam", "sir");
set("Lord/Lady", "Lord");
set("lord/lady", "lord");
set("handsome/pretty", "handsome");
}

if (gender = "Female")
{
set("Boy/Girl", "Girl");
set("boy/girl", "girl");
set("Man/Woman", "Woman");
set("man/woman", "woman");
set("Sir/Madam", "Madam");
set("sir/madam", "madam");
set("Lord/Lady", "Lady");
set("lord/lady", "lady");
set("handsome/pretty", "pretty");
}
set ("fullname", get("firstname") + " " + get("lastname"));


Character name: {fullname}<br>
Gender: {gender} <br>
Race: {race} <br>
Class: {Class} <br>
Special skill (once per day): {skill} <br>
Hitpoints: {hitpoints} <br>

Aren't you a {handsome/pretty} {boy/girl}

Alex
You need to use "==" not "=" in your if statements.

Rockenden
Aww man. I used to know that.
Cheers,

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

Support

Forums