mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
More work on the scripts (just playing around)
git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@71 ea6a568a-9f4f-0410-981a-c910a81bb256
This commit is contained in:
parent
394c1d18aa
commit
c2d992c8f0
27
mscripts/gameobjects/equipitem.mn
Normal file
27
mscripts/gameobjects/equipitem.mn
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
OpenMW - The completely unofficial reimplementation of Morrowind
|
||||
Copyright (C) 2008 Nicolay Korslund
|
||||
Email: < korslund@gmail.com >
|
||||
WWW: http://openmw.snaptoad.com/
|
||||
|
||||
This file (equipitem.mn) is part of the OpenMW package.
|
||||
|
||||
OpenMW is distributed as free software: you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License
|
||||
version 3, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
version 3 along with this program. If not, see
|
||||
http://www.gnu.org/licenses/ .
|
||||
|
||||
*/
|
||||
|
||||
// Anything that can be equiped, like clothes, armor and weapons.
|
||||
class EquipItem : InventoryItem;
|
||||
|
||||
int enchant;
|
@ -4,7 +4,7 @@
|
||||
Email: < korslund@gmail.com >
|
||||
WWW: http://openmw.snaptoad.com/
|
||||
|
||||
This file (cellobject.mn) is part of the OpenMW package.
|
||||
This file (gameobject.mn) is part of the OpenMW package.
|
||||
|
||||
OpenMW is distributed as free software: you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License
|
||||
@ -23,9 +23,18 @@
|
||||
|
||||
// An object that exists inside a cell. All cell objects must have a
|
||||
// position in space.
|
||||
class CellObject : Object;
|
||||
class GameObject : Object;
|
||||
|
||||
// Position and rotation in space
|
||||
// Is this object placed in a cell? isPlaced is true if the object is
|
||||
// displayed inside a cell with a mesh and given 3D coordinates, and
|
||||
// false otherwise (eg. if it is part of the player's inventory or in
|
||||
// a container.)
|
||||
|
||||
// TODO: This will change to an actual cell reference later on, and be
|
||||
// null if the object is not placed.
|
||||
bool isPlaced;
|
||||
|
||||
// Position and rotation in space (only valid if isPlaced is true.)
|
||||
float x, y, z;
|
||||
float r1, r2, r3;
|
||||
|
28
mscripts/gameobjects/inventoryitem.mn
Normal file
28
mscripts/gameobjects/inventoryitem.mn
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
OpenMW - The completely unofficial reimplementation of Morrowind
|
||||
Copyright (C) 2008 Nicolay Korslund
|
||||
Email: < korslund@gmail.com >
|
||||
WWW: http://openmw.snaptoad.com/
|
||||
|
||||
This file (inventoryitem.mn) is part of the OpenMW package.
|
||||
|
||||
OpenMW is distributed as free software: you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License
|
||||
version 3, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
version 3 along with this program. If not, see
|
||||
http://www.gnu.org/licenses/ .
|
||||
|
||||
*/
|
||||
|
||||
class InventoryItem : GameObject;
|
||||
|
||||
float weight;
|
||||
int value;
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
*/
|
||||
|
||||
class Light : CellObject;
|
||||
class Light : InventoryItem;
|
||||
|
||||
// Time left in seconds (for carried lights)
|
||||
float lifetime;
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
// Objects that can have a lock level and a trap
|
||||
class LockedObject : CellObject;
|
||||
class LockedObject : GameObject;
|
||||
|
||||
// ID of key and trap type.
|
||||
char[] key, trap;
|
31
mscripts/gameobjects/weapon.mn
Normal file
31
mscripts/gameobjects/weapon.mn
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
OpenMW - The completely unofficial reimplementation of Morrowind
|
||||
Copyright (C) 2008 Nicolay Korslund
|
||||
Email: < korslund@gmail.com >
|
||||
WWW: http://openmw.snaptoad.com/
|
||||
|
||||
This file (weapon.mn) is part of the OpenMW package.
|
||||
|
||||
OpenMW is distributed as free software: you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License
|
||||
version 3, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
version 3 along with this program. If not, see
|
||||
http://www.gnu.org/licenses/ .
|
||||
|
||||
*/
|
||||
|
||||
// Weapons (This is just an example, it's not used for anything yet.)
|
||||
class Weapon : EquipItem;
|
||||
|
||||
float speed, reach;
|
||||
|
||||
bool magical, silver;
|
||||
bool isTwohanded;
|
||||
|
@ -35,7 +35,7 @@ void initMonsterScripts()
|
||||
{
|
||||
// Add the script directories
|
||||
MonsterClass.addPath("mscripts/");
|
||||
MonsterClass.addPath("mscripts/cellobjects/");
|
||||
MonsterClass.addPath("mscripts/gameobjects/");
|
||||
MonsterClass.addPath("mscripts/sound/");
|
||||
|
||||
// Make sure the Object class is loaded
|
||||
|
@ -42,7 +42,7 @@ import scene.player;
|
||||
// Generic version of a "live" object
|
||||
struct GenLive(T)
|
||||
{
|
||||
// Instance of class CellObject or a derived class (depending on
|
||||
// Instance of class GameObject or a derived class (depending on
|
||||
// object type)
|
||||
MonsterObject *obj;
|
||||
T *m;
|
||||
@ -259,13 +259,13 @@ class CellData
|
||||
private:
|
||||
|
||||
static
|
||||
MonsterClass cellObjC, doorC, lightC, lockedC;
|
||||
MonsterClass gameObjC, doorC, lightC, lockedC;
|
||||
|
||||
void setup()
|
||||
{
|
||||
if(cellObjC !is null) return;
|
||||
if(gameObjC !is null) return;
|
||||
|
||||
cellObjC = new MonsterClass("CellObject");
|
||||
gameObjC = new MonsterClass("GameObject");
|
||||
doorC = new MonsterClass("Door");
|
||||
lightC = new MonsterClass("Light");
|
||||
lockedC = new MonsterClass("LockedObject");
|
||||
@ -310,7 +310,7 @@ class CellData
|
||||
{
|
||||
LiveStatic ls;
|
||||
ls.m = s;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
statics.insert(ls);
|
||||
stat = true;
|
||||
@ -320,7 +320,7 @@ class CellData
|
||||
{
|
||||
LiveMisc ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
miscItems.insert(ls);
|
||||
}
|
||||
@ -366,7 +366,7 @@ class CellData
|
||||
{
|
||||
LiveActivator ls;
|
||||
ls.m = a;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
activators.insert(ls);
|
||||
activator = true;
|
||||
@ -376,7 +376,7 @@ class CellData
|
||||
{
|
||||
LiveNPC ls;
|
||||
ls.m = n;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
npcs.insert(ls);
|
||||
}
|
||||
@ -384,7 +384,7 @@ class CellData
|
||||
{
|
||||
LivePotion ls;
|
||||
ls.m = p;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
potions.insert(ls);
|
||||
}
|
||||
@ -392,7 +392,7 @@ class CellData
|
||||
{
|
||||
LiveApparatus ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
appas.insert(ls);
|
||||
}
|
||||
@ -400,7 +400,7 @@ class CellData
|
||||
{
|
||||
LiveIngredient ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
ingredients.insert(ls);
|
||||
}
|
||||
@ -408,7 +408,7 @@ class CellData
|
||||
{
|
||||
LiveArmor ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
armors.insert(ls);
|
||||
}
|
||||
@ -416,7 +416,7 @@ class CellData
|
||||
{
|
||||
LiveWeapon ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
weapons.insert(ls);
|
||||
}
|
||||
@ -424,7 +424,7 @@ class CellData
|
||||
{
|
||||
LiveBook ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
books.insert(ls);
|
||||
}
|
||||
@ -432,7 +432,7 @@ class CellData
|
||||
{
|
||||
LiveClothing ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
clothes.insert(ls);
|
||||
}
|
||||
@ -440,7 +440,7 @@ class CellData
|
||||
{
|
||||
LiveTool ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
tools.insert(ls);
|
||||
}
|
||||
@ -448,7 +448,7 @@ class CellData
|
||||
{
|
||||
LiveTool ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
tools.insert(ls);
|
||||
}
|
||||
@ -456,7 +456,7 @@ class CellData
|
||||
{
|
||||
LiveTool ls;
|
||||
ls.m = m;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
tools.insert(ls);
|
||||
}
|
||||
@ -464,7 +464,7 @@ class CellData
|
||||
{
|
||||
LiveCreature ls;
|
||||
ls.m = c;
|
||||
ls.obj = cellObjC.createObject;
|
||||
ls.obj = gameObjC.createObject;
|
||||
mo = ls.obj;
|
||||
creatures.insert(ls);
|
||||
}
|
||||
@ -475,7 +475,7 @@ class CellData
|
||||
ls.m = l.instCreature(playerData.level);
|
||||
if(ls.m != null)
|
||||
{
|
||||
ls.obj = cellObjC.createObject; mo = ls.obj;
|
||||
ls.obj = gameObjC.createObject; mo = ls.obj;
|
||||
creatures.insert(ls);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user