UrsZeidler / shr5rcp

The shadowrun 5 rich client platfrom is a model driven project for managing shadowrun resources. A shadowrun 5 character generator for example ...
http://urszeidler.github.io/shr5rcp/
49 stars 9 forks source link

Calculation of mental limit #204

Closed Tom-0169 closed 9 years ago

Tom-0169 commented 9 years ago

Mental [(Logic x 2 ) + Intuition + Willpower] / 3 (round up) Physical [(Strength x 2) + Body + Reaction] / 3 (round up) Social [(Charisma x 2) + Willpower + Essence] / 3 (round up)

UrsZeidler commented 9 years ago

I have added some Testcases, and it looks fine to me:

 /**
    * Tests the '{@link de.urszeidler.eclipse.shr5.ChrakterLimits#getGeistig()
    * <em>Geistig</em>}' feature getter. <!-- begin-user-doc --> <!--
    * end-user-doc -->
    * 
    * @see de.urszeidler.eclipse.shr5.ChrakterLimits#getGeistig()
    * @generated not
    */
   public void testGetGeistig() {
    fixture.setLogikBasis(1);
    fixture.setIntuitionBasis(2);
    fixture.setWillenskraftBasis(2);

    assertEquals("limit need to be 2", 2, fixture.getGeistig());

    fixture.setLogikBasis(3);
    fixture.setIntuitionBasis(3);
    fixture.setWillenskraftBasis(4);

    assertEquals("limit need to be 5", 5, fixture.getGeistig());

    // megapulse example
    fixture.setLogikBasis(4);
    fixture.setIntuitionBasis(4);
    fixture.setWillenskraftBasis(3);

    assertEquals("limit need to be 5", 5, fixture.getGeistig());

    //rob example
    fixture.setLogikBasis(3);
    fixture.setIntuitionBasis(3);
    fixture.setWillenskraftBasis(4);

    assertEquals("limit need to be 5", 5, fixture.getGeistig());
    // anoher
    fixture.setLogikBasis(1);
    fixture.setIntuitionBasis(1);
    fixture.setWillenskraftBasis(1);

    assertEquals("limit need to be 2", 2, fixture.getGeistig());

}

The code is straight forward:

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated not
 */
public int getGeistig() {
    double baselimit1 = ((getLogik() * 2) + getIntuition() + getWillenskraft()) / 3.0;
    int baselimit = (int) Math.ceil(baselimit1);
    int getmodWert = modManager.getmodWert(Shr5Package.Literals.CHRAKTER_LIMITS__GEISTIG);
    return baselimit + getmodWert;
}

If you have an example it would be helpful. Simply open the issue again.

Tom-0169 commented 9 years ago

It's reproducable, but minor. The base code is good. Create a character, type in the attributes. Type in Logic last. Don't hit enter. Instead leave directly to a skillgroup. I think it's a minor glitch in the UI. Something like a an mouse-event don't starting

(Sorry new to this, have to look at the documentation for re-opening an issue)

UrsZeidler commented 9 years ago

I see, will take a look at the notifications, thanks.