<?php
//TODO Add MOD to database.
//Move definitions to default MOD
define ('challenge_EASY', X);
define ('challenge_MEDIUM', X);
define ('challenge_HIGH', X);
define ('challenge_MIRACULOUS', X);
/*
Before you write your own mechanic
1) do you understand the differences
2) Keep your database code inside the
The mechanic is responsible for fetching character specific, thus:
character::getStat(STAT_NAME); //good
and
$sql = select STAT_NAME from... // bad
3) Remember: during GAMEPLAY, the PC and all "companions" NPCs are sessioned, so pull from the session, not the DB
Mechanic Class
abstract mechanic handler -
If a contributor wants to implement a different game mechanic, this is the class they extend to do so, which is placed in the
mechanic/MOD folder, named gamemech.php
- class gamemech extends mechanic
Implements:
createPC - happens in GAMEPLAY when a player starts a new game
editPC - happens in GAMEPLAY as a consequence
deletePC - happens when a player deletes a saved game.
createNPC - happens by contributors/editors
editNPC - happens both in Gameplay and Design
deleteNPC - happens by contributors/editors
checkStat - GAMEPLAY
checkLoyalty - GAMEPLAY - PC to NPC interaction
contest - GAMEPLAY - PC to NPC interaction
*/
class mechanic {
/*
*/
public function createPC(){
}
/*
*/
public function editPC() {
}
/*
*/
public function deletePC () {
}
/*
*/
public function createNPC () {
}
/*
*/
public function editNPC () {
}
/*
*/
public function deleteNPC () {
}
/*
Challenge
When a character attempts to do something that is a specific challenge as
designated by the Designer, such as pick a lock.
*/
public function challenge ($stat, $difficulty) {
}
/*
*/
public function checkLoyalty () {
}
/*
*/
public function contest () {
}
}
?>