User Tools

Site Tools


en:rpd:artifact_buff

Artifact Buff

Artifact Buff

Description

Artifact Buff is a base class for artifact-related buffs in Remixed Dungeon. It extends the standard Buff class and adds specific behavior for artifact-sourced buffs.

Key Features

  • Source Tracking: Each ArtifactBuff tracks its source entity ID via `getSourceId()`
  • Auto-Detach: If the source ID is `EntityIdSource.INVALID_ID` (meaning non-artifact source), the buff automatically detaches
  • Persistence: Artifact buffs with valid source IDs don't get packed/saved with the game state (`dontPack()` returns `true`)
  • Entity Kind: Returns “artifactBuffâ€� + parent entity kind for unique identification

Code Implementation

public class ArtifactBuff extends Buff {
 
    @Override
    public void act() {
        if(getSourceId()==EntityIdSource.INVALID_ID) { // non-artifact source
            detach();
        }
        super.act();
    }
 
    public String getEntityKind() {
        return "artifactBuff" + super.getEntityKind();
    }
 
    @Override
    public boolean dontPack() {
        return getSourceId()!= EntityIdSource.INVALID_ID;
    }
}

Known Subclasses

Code References

String Resources

Artifact buffs use the string resources of their specific implementations. See individual buff pages for string references.

en/rpd/artifact_buff.txt · Last modified: by 127.0.0.1