Skip to content

Commit

Permalink
Add transformation effect to vampires
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Jul 9, 2024
1 parent df48d0d commit 65fb174
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
Binary file added data/sprites/entity/overlay/transform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Changelog
- added parallax backgrounds to Wizards Tower
- added quick menu button to toggle pathfinding via ground
- added support for animated entity overlay effects
- added transformation effect to vampires


1.47
Expand Down
1 change: 1 addition & 0 deletions doc/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,7 @@ The following people released their work to the public with a suitable license f
* [Inchadney](http://inchadney.com/sounds.html)
* [Bart Kelsey](https://opengameart.org/users/bart)
* [David Kvistorf (fluffclipse)](https://soundcloud.com/david-kvistorf)
* [Aidan Walker](https://opengameart.org/users/aidanwalker)
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
4 changes: 4 additions & 0 deletions doc/contributors/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,10 @@
"fullname": "David Kvistorf",
"link": "https://soundcloud.com/david-kvistorf",
"link_alt": "https://opengameart.org/users/fluffclipse"
},
{
"name": "Aidan Walker",
"link": "https://opengameart.org/users/aidanwalker"
}
]
}
1 change: 1 addition & 0 deletions doc/sources/graphics-entity.txt
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ flame* DkuCook, Jordan Irwin (AntumDeluge); CC0; https://opengameart.or
ice_sparkles* Jordan Irwin (AntumDeluge); OGA BY 3.0 or newer; Stendhal
magic_sparkles Rawdanitsu, olonu; CC0; https://opengameart.org/node/18068
necro_flames Wolf W. (Ouren), Jordan Irwin (AntumDeluge); CC BY 3.0; https://opengameart.org/node/45981
transform Aidan Walker; CC0; https://opengameart.org/node/160840


data/sprites/entity/ratfolk/
Expand Down
15 changes: 15 additions & 0 deletions src/js/stendhal/entity/Creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { EntityOverlayRegistry } from "../data/EntityOverlayRegistry";

import { Color } from "../data/color/Color";

import { SkillEffect } from "../sprite/action/SkillEffect";

declare var marauroa: any;
declare var stendhal: any;

Expand Down Expand Up @@ -53,4 +55,17 @@ export class Creature extends RPEntity {
return "url(" + stendhal.paths.sprites + "/cursor/attack.png) 1 3, auto";
}

/**
* Shows a temporary animation overlay for certain entities.
*
* FIXME: does not restore previous overlay
*/
protected override onTransformed() {
if (!this["name"].startsWith("vampire")) {
return;
}
const delay = 100;
const frames = 5;
this.overlay = new SkillEffect("transform", delay, delay * frames);
}
}
11 changes: 11 additions & 0 deletions src/js/stendhal/entity/RPEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export class RPEntity extends ActiveEntity {
this.onLevelChanged(key, value, oldValue);
} else if (["title", "name", "class", "type"].indexOf(key) >-1) {
this.createTitleTextSprite();
} else if (key === "subclass" && typeof(oldValue) !== "undefined" && value !== oldValue) {
this.onTransformed();
}
}

Expand Down Expand Up @@ -848,4 +850,13 @@ export class RPEntity extends ActiveEntity {
this._target.onAttackStopped(this);
}
}

/**
* Called when entity's subclass is changed.
*
* Does nothing in this implementation.
*/
protected onTransformed() {
// do nothing
}
}

0 comments on commit 65fb174

Please sign in to comment.