/**
   * This returns NonPlayerCharacter.gif.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated not
   */
  @Override
  public Object getImage(Object object) {
    ManagedCharacter pc = (ManagedCharacter) object;

    ComposeableAdapterFactory factory =
        ((Shr5managementItemProviderAdapterFactory) this.adapterFactory).getRootAdapterFactory();
    if (factory != null && pc.getPersona() != null) {
      IItemLabelProvider labelprovider =
          (IItemLabelProvider) factory.adapt(pc.getPersona(), IItemLabelProvider.class);
      if (labelprovider != null) return labelprovider.getImage(pc.getPersona());
    }

    return overlayImage(object, getResourceLocator().getImage("full/obj16/NonPlayerCharacter"));
  }
Exemplo n.º 2
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated not
   */
  public int calcAttributesSpend(ManagedCharacter context) {
    ManagedCharacter managedCharacter = context;
    if (managedCharacter == null) return 0;
    AbstraktPersona persona = managedCharacter.getPersona();
    if (persona == null) return 0;

    Spezies spezies = persona.getSpezies();
    if (spezies == null) return 0;

    int a =
        persona.getKonstitutionBasis()
            - spezies.getKonstitutionMin()
            + persona.getStaerkeBasis()
            - spezies.getStaerkeMin()
            + persona.getReaktionBasis()
            - spezies.getReaktionMin()
            + persona.getGeschicklichkeitBasis()
            - spezies.getGeschicklichkeitMin()
            + persona.getCharismaBasis()
            - spezies.getCharismaMin()
            + persona.getLogikBasis()
            - spezies.getLogikMin()
            + persona.getWillenskraftBasis()
            - spezies.getWillenskraftMin()
            + persona.getIntuitionBasis()
            - spezies.getIntuitionMin();

    // TODO : need remove the karma
    return a;
  }
Exemplo n.º 3
0
  private Print printNpcSheet(ManagedCharacter managedCharacter, int intValue) {
    DefaultGridLook look = new DefaultGridLook(10, 0);
    look.setHeaderGap(0);
    GridPrint grid = new GridPrint("d,d:g,d,d,d:g", look); // $NON-NLS-1$

    int zustandKoerperlichMax = 8;
    AbstraktPersona persona = managedCharacter.getPersona();
    if (persona instanceof KoerperPersona) {
      KoerperPersona kp = (KoerperPersona) persona;
      zustandKoerperlichMax = kp.getZustandKoerperlichMax();
    }
    grid.add(printPersonaAttributes(persona), 2);
    for (int i = 0; i < intValue; i++) {
      grid.add(
          SWT.LEFT,
          SWT.TOP,
          printConditionMonitor(persona.getName() + ONE_SPACE + (i + 1), zustandKoerperlichMax));
    }
    grid.add(new EmptyPrint(), GridPrint.REMAINDER);
    grid.add(printPersonaWeaponsDetailList(managedCharacter), 5);
    grid.add(new LinePrint(SWT.HORIZONTAL), GridPrint.REMAINDER);

    DefaultGridLook look1 = new DefaultGridLook(5, 5);
    look.setHeaderGap(0);
    GridPrint grid1 = new GridPrint("d,d,d", look1); // $NON-NLS-1$

    grid1.add(printPersonaCombatAttributes(persona));
    grid1.add(printPersonaSkills(persona));
    grid1.add(printGegenstandList(managedCharacter.getInventar(), Messages.Printer_Items));
    grid.add(grid1, GridPrint.REMAINDER);

    return grid;
  }
  /**
   * This returns the label text for the adapted class.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated not
   */
  @Override
  public String getText(Object object) {
    ManagedCharacter pc = (ManagedCharacter) object;
    if (pc.getPersona() != null) {
      ComposeableAdapterFactory factory =
          ((Shr5managementItemProviderAdapterFactory) this.adapterFactory).getRootAdapterFactory();
      IItemLabelProvider labelprovider =
          (IItemLabelProvider) factory.adapt(pc.getPersona(), IItemLabelProvider.class);

      if (labelprovider != null)
        return getString("_UI_NonPlayerCharacter_type")
            + " "
            + labelprovider.getText(pc.getPersona());
    }

    return getString("_UI_NonPlayerCharacter_type");
  }